mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
honour g_mem_gc_friendly settings when freeing slices, make sure
Wed Jan 25 16:39:18 2006 Tim Janik <timj@imendio.com> * glib/gslice.c: honour g_mem_gc_friendly settings when freeing slices, make sure g_mem_gc_friendly is properly initialized. * gmem.[hc]: ensure g_mem_gc_friendly is initialized from G_DEBUG upon the first allocation. applied some branching optimizations. * docs/macros.txt: reflected --enable-gc-friendly change and described ENABLE_GC_FRIENDLY_DEFAULT as well as G_DEBUG=gc-friendly. * configure.in: changed --enable-gc-friendly=yes to define ENABLE_GC_FRIENDLY_DEFAULT. * glib/garray.c: changed ENABLE_GC_FRIENDLY macro #ifdef-s to if (G_UNLIKELY (g_mem_gc_friendly)). * glib/gtree.c: * glib/ghash.c: removed ENABLE_GC_FRIENDLY code which is now taken care of by g_slice_free1(). * tests/slice-test.c: fixed leaks, reported by Kjartan Maraas.
This commit is contained in:
@@ -126,6 +126,8 @@ test_memchunk_thread (gpointer data)
|
||||
for (i = 0; i < prime_size; i++)
|
||||
if (memchunks[i])
|
||||
old_mem_chunk_destroy (memchunks[i]);
|
||||
g_free (ps);
|
||||
g_free (ss);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -178,6 +180,8 @@ test_sliced_mem_thread (gpointer data)
|
||||
for (j = 0; j < k; j++)
|
||||
g_slice_free1 (sz, ps[j]);
|
||||
}
|
||||
g_free (ps);
|
||||
g_free (ss);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user