+Fri Dec 29 13:28:07 2006 Tim Janik <timj@imendio.com>
+
+ * glib/gslice.c: turned detection of too late g_thread_init() calls
+ into a warning. this is a temporary work-around for some head-room
+ to fix affected programs, memory corruption still occours regardless.
+
2006-12-29 Matthias Clasen <mclasen@redhat.com>
* tests/gobject/Makefile.am:
#include <process.h>
#endif
+#include <stdio.h> /* fputs/fprintf */
+
+
/* the GSlice allocator is split up into 4 layers, roughly modelled after the slab
* allocator and magazine extensions as outlined in:
* + [Bonwick94] Jeff Bonwick, The slab allocator: An object-caching kernel
{
/* we may not use g_error() or friends here */
if (sys_page_size)
- mem_error ("g_thread_init() must be called before GSlice is used, memory corrupted...");
- g_slice_init_nomessage();
+ {
+ /* mem_error ("g_thread_init() must be called before GSlice is used, memory corrupted..."); */
+ fputs ("\n***MEMORY-WARNING***: ", stderr);
+ const char *pname = g_get_prgname();
+ fprintf (stderr, "%s[%u]: GSlice: ", pname ? pname : "", getpid());
+ fputs ("g_thread_init() must be called before all other GLib functions; "
+ "memory corruption due to late invocation of g_thread_init() has been detected; "
+ "this program is likely to crash, leak or unexpectedly abort soon...\n", stderr);
+ }
+ if (!sys_page_size)
+ g_slice_init_nomessage();
private_thread_memory = g_private_new (private_thread_memory_cleanup);
allocator->magazine_mutex = g_mutex_new();
allocator->slab_mutex = g_mutex_new();
#endif
}
-#include <stdio.h>
-
static void
mem_error (const char *format,
...)