2
0
Fork 0

[profiler] use g_static_mutex to trigger mutext memory allocation before registering profiler alloc handlers

personal/stbuehler/wip
Stefan Bühler 2012-12-06 15:34:51 +01:00
parent af3e0728fa
commit 178e7c898f
1 changed files with 4 additions and 0 deletions

View File

@ -249,6 +249,10 @@ static void profiler_dump_frame(guint level, profiler_stackframe *frame, gsize m
void li_profiler_enable(gchar *output_path) {
GMemVTable t;
/* force allocation of mutex data; newer glib versions allocate extra data */
g_static_mutex_lock(&profiler_mutex);
g_static_mutex_unlock(&profiler_mutex);
profiler_heap_base = sbrk(0);
if (g_str_equal(output_path, "stdout")) {