diff --git a/config.h.meson b/config.h.meson index fd0bfcaf9..3dae039f1 100644 --- a/config.h.meson +++ b/config.h.meson @@ -32,9 +32,6 @@ /* Whether to disable memory pools */ #mesondefine DISABLE_MEM_POOLS -/* Whether to enable GC friendliness by default */ -#mesondefine ENABLE_GC_FRIENDLY_DEFAULT - /* always defined to indicate that i18n is enabled */ #mesondefine ENABLE_NLS diff --git a/config.h.win32.in b/config.h.win32.in index 14ac11d39..dfe0ccc66 100644 --- a/config.h.win32.in +++ b/config.h.win32.in @@ -28,9 +28,6 @@ /* Whether to disable memory pools */ /* #undef DISABLE_MEM_POOLS */ -/* Whether to enable GC friendliness by default */ -/* #undef ENABLE_GC_FRIENDLY_DEFAULT */ - /* always defined to indicate that i18n is enabled */ #define ENABLE_NLS 1 diff --git a/configure.ac b/configure.ac index be48c9a19..513cac83b 100644 --- a/configure.ac +++ b/configure.ac @@ -248,10 +248,6 @@ AC_ARG_ENABLE(debug, [turn on debugging @<:@default=glib_debug_default@:>@]),, enable_debug=glib_debug_default) -AC_ARG_ENABLE(gc_friendly, - [AS_HELP_STRING([--enable-gc-friendly], - [turn on garbage collector friendliness [default=no]])],, - [enable_gc_friendly=no]) AC_ARG_ENABLE(mem_pools, [AS_HELP_STRING([--disable-mem-pools], [disable all glib memory pools])],, @@ -259,12 +255,6 @@ AC_ARG_ENABLE(mem_pools, GLIB_TESTS -AC_MSG_CHECKING([whether to enable garbage collector friendliness]) -AS_IF([test "x$enable_gc_friendly" = "xyes"], [ - AC_DEFINE(ENABLE_GC_FRIENDLY_DEFAULT, 1, [Whether to enable GC friendliness by default]) - AC_MSG_RESULT([yes]) -], [ AC_MSG_RESULT([no]) ]) - AC_MSG_CHECKING([whether to disable memory pools]) AS_IF([test "x$disable_mem_pools" = "xno"], [ AC_MSG_RESULT([no]) diff --git a/docs/macros.txt b/docs/macros.txt index 8b4202987..5ca0b941b 100644 --- a/docs/macros.txt +++ b/docs/macros.txt @@ -9,8 +9,6 @@ GLib's configure options and corresponding macros none --enable-debug=yes [default for development branches] -DG_ENABLE_DEBUG -g ---enable-gc-friendly=yes - #define ENABLE_GC_FRIENDLY_DEFAULT 1 --disable-mem-pools=yes #define DISABLE_MEM_POOLS 1 @@ -22,14 +20,6 @@ and/or third party code. Notes on GLib's internal and global macros ========================================== - -ENABLE_GC_FRIENDLY_DEFAULT - Newly allocated memory that isn't directly initialized, as well - as memory being freed should be reset to 0. The point here is to - allow memory checkers and similar programs that use bohem GC alike - algorithms to produce more accurate results. - This can also be accomplished by setting the environment variable - G_DEBUG=gc-friendly. DISABLE_MEM_POOLS Many small chunks of memory are often allocated via collective pools in GLib and are cached after release to speed up reallocations. diff --git a/docs/reference/glib/building.xml b/docs/reference/glib/building.xml index 57c3c8c7d..6c1a0c2d5 100644 --- a/docs/reference/glib/building.xml +++ b/docs/reference/glib/building.xml @@ -227,66 +227,6 @@ - - <option>--disable-gc-friendly</option> and - <option>--enable-gc-friendly</option> - - - By default, and with - as well, GLib does not clear the memory for certain objects before - they are freed. For example, GLib may decide to recycle GList nodes - by putting them in a free list. However, memory profiling and debugging - tools like Valgrind work - better if an application does not keep dangling pointers to freed - memory (even though these pointers are no longer dereferenced), or - invalid pointers inside uninitialized memory. - The option makes GLib - clear memory in these situations: - - - - - - When shrinking a GArray, GLib will clear the memory no longer - available in the array: shrink an array from 10 bytes to 7, and - the last 3 bytes will be cleared. This includes removals of single - and multiple elements. - - - - - When growing a GArray, GLib will clear the new chunk of memory. - Grow an array from 7 bytes to 10 bytes, and the last 3 bytes will - be cleared. - - - - - The above applies to GPtrArray as well. - - - - - When freeing a node from a GHashTable, GLib will first clear - the node, which used to have pointers to the key and the value - stored at that node. - - - - - When destroying or removing a GTree node, GLib will clear the node, - which used to have pointers to the node's value, and the left and - right subnodes. - - - - - - Since clearing the memory has a cost, - is the default. - - - <option>--disable-mem-pools</option> and <option>--enable-mem-pools</option> diff --git a/glib/glib-init.c b/glib/glib-init.c index 5f312113a..2e229667f 100644 --- a/glib/glib-init.c +++ b/glib/glib-init.c @@ -74,11 +74,8 @@ G_STATIC_ASSERT (_g_alignof (TestInt) == _g_alignof (int)); * This variable is %TRUE if the `G_DEBUG` environment variable * includes the key `gc-friendly`. */ -#ifdef ENABLE_GC_FRIENDLY_DEFAULT -gboolean g_mem_gc_friendly = TRUE; -#else gboolean g_mem_gc_friendly = FALSE; -#endif + GLogLevelFlags g_log_msg_prefix = G_LOG_LEVEL_ERROR | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_DEBUG; GLogLevelFlags g_log_always_fatal = G_LOG_FATAL_MASK;