ARRAY_LENGTH macro is used in perf's cairo-perf.h, src's cairoint.h,
test's cairo-test.h and in some internal header files of util's
directory.So to maintain consistency ARRAY_SIZE is replaced with
ARRAY_LENGTH macro.
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
At Behdad's request, convert the array of allocators into a simple hash
table (large static number of buckets + chaining) in order to speed up
malloc profiling.
Apparently glibc already provides the function:
void malloc_stats (void);
So, like we do for backtrace_symbols(), override the public symbol.
It still is defined as __destructor__ and runs at program finalization.
To build, do:
make malloc-stats.so
inside util/, and to use, run:
LD_PRELOAD=malloc-stats.so some-program
For binaries managed by libtool, eg, cairo-perf, do:
../libtool --mode=execute /bin/true ./cairo-perf
LD_PRELOAD="../util/malloc-stats.so" .libs/lt-cairo-perf
The code also includes Jeff Muizelaar's libbacktracesymbols that
is a much better implementation of backtrace_symbols() than what
is provided by glibc. That can be built by:
make backtrace-symbols.so