Added --disable-mem-pools option.

2000-12-19  Alexander Larsson  <alexl@redhat.com>

	* configure.in:
	Added --disable-mem-pools option.

	* glist.c:
	* gslist.c:
	* gnode.c:
	* gmem.c:
	Disable free list and memory chunks if DISABLE_MEM_POOLS is defined.
This commit is contained in:
Alexander Larsson
2000-12-19 09:35:44 +00:00
committed by Alexander Larsson
parent 4f9e04c1d7
commit c7f80dbb13
17 changed files with 509 additions and 2 deletions

View File

@@ -28,9 +28,14 @@
* MT safe
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "glib.h"
#ifndef DISABLE_MEM_POOLS
struct _GAllocator /* from gmem.c */
{
gchar *name;
@@ -197,6 +202,41 @@ g_list_free_1 (GList *list)
_g_list_free_1 (list);
}
#else /* DISABLE_MEM_POOLS */
#define _g_list_alloc g_list_alloc
GList*
g_list_alloc (void)
{
GList *list;
list = g_new0 (GList, 1);
return list;
}
void
g_list_free (GList *list)
{
GList *last;
while (list)
{
last = list;
list = list->next;
g_free (last);
}
}
#define _g_list_free_1 g_list_free_1
void
g_list_free_1 (GList *list)
{
g_free (list);
}
#endif
GList*
g_list_append (GList *list,
gpointer data)