I want to test the performance improvement that I could get by using Google's tcmalloc. My program is built using quite a lot of the utilities provided by glib (hashes, lists, arrays, ...). So what I want is basically to make glib to use tcmalloc instead of glibc's malloc.
I could address this issue with two approaches:
- By compiling glib with the
-tcmalloc
option. - by using
g_mem_set_vtable ()
from the glib's memory allocation functions.
I actually prefer the second one but I have not found any examples for implementing it.
Any hints ? Any ideas for doing this ?