summaryrefslogtreecommitdiff
path: root/glist.c
diff options
context:
space:
mode:
Diffstat (limited to 'glist.c')
-rw-r--r--glist.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/glist.c b/glist.c
index 4b5934432..9ca754a45 100644
--- a/glist.c
+++ b/glist.c
@@ -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)