mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
added mem_error() and mem_assert() to test and handle errors without
Tue Dec 20 18:14:14 2005 Tim Janik <timj@imendio.com> * glib/gslice.[hc]: added mem_error() and mem_assert() to test and handle errors without depending on gmessage.c which might not be setup when the error occours. removed G_SLICE_CONFIG_ALWAYS_FREE config option, fixed the code so always freeing can be achieved by adjusting the working set time to 0 with G_SLICE_CONFIG_WORKING_SET_MSECS. added G_SLICE_CONFIG_COLOR_INCREMENT to test different color increments (mainly 0 and 1). reduced the minimum block size to 128 bytes, to minimize wastage if small amounts of differently sized structrues are allocated, this does come at a performance cost of roughly 5% though. fixed up block alignment calculation, so it works for varying block sizes. only use strerror() not g_strerror() since the latter depends on working GQuark and GSlice. mem_error(): implemented in terms of fprintf and vfprintf. * tests/slice-color.c: new program to test cache colorization effects. * tests/slice-test.c: trade G_SLICE_CONFIG_ALWAYS_FREE for 0 duration G_SLICE_CONFIG_WORKING_SET_MSECS.
This commit is contained in:
@@ -220,7 +220,7 @@ main (int argc,
|
||||
mode = "old memchunks";
|
||||
break;
|
||||
case 'f': /* eager freeing */
|
||||
g_slice_set_config (G_SLICE_CONFIG_ALWAYS_FREE, TRUE);
|
||||
g_slice_set_config (G_SLICE_CONFIG_WORKING_SET_MSECS, 0);
|
||||
clean_memchunks = TRUE;
|
||||
emode = " with eager freeing";
|
||||
break;
|
||||
|
Reference in New Issue
Block a user