summaryrefslogtreecommitdiff
path: root/glib/gmem.h
diff options
context:
space:
mode:
authorTim Janik <timj@imendio.com>2005-12-01 16:34:33 +0000
committerTim Janik <timj@src.gnome.org>2005-12-01 16:34:33 +0000
commit733b1789c17ab4c6378ce0e9594f62dda1473ebb (patch)
tree3e8d953d07b8a5e06aaa1d06c3889ccd832a3329 /glib/gmem.h
parentd871f19c3074f37df65b6d304f4eacbe19c4b46c (diff)
downloadglib-733b1789c17ab4c6378ce0e9594f62dda1473ebb.tar.gz
new slice allocator implementation.
Thu Dec 1 17:32:46 2005 Tim Janik <timj@imendio.com> * glib/gslice.[hc]: new slice allocator implementation. * tests/slice-test.c: added random slice allocation test. * glib/gthread.[hc]: removed newly added private thread mem API. * glib/gthreadinit.h: * glib/gmessages.c: * glib/gthread.c: * glib/gmem.c: divided glib threading initialisation into three phases, initialisation where private keys and messaging are not available (only needed by gmem.c), initialisation without messaging but private keys available (gslice.c, gmessage.c), and full fledged initialisers that server the rest of glib. initialisation functions got renamed to reflect the limitations of their corresponding phases. * glib/gmem.c: removed memchunk code, defer allocations to g_slice_* instead. * glib/gmem.[hc]: removed g_slice_* skeletons. * glib/glib.symbols: added g_slice_* symbols. * configure.in: check for availability of posix_memalign(3), memalign(3) and valloc(3). * glib/Makefile.am: added gslice.[hc].
Diffstat (limited to 'glib/gmem.h')
-rw-r--r--glib/gmem.h14
1 files changed, 1 insertions, 13 deletions
diff --git a/glib/gmem.h b/glib/gmem.h
index 6e1773ed2..ae8756ed3 100644
--- a/glib/gmem.h
+++ b/glib/gmem.h
@@ -27,6 +27,7 @@
#ifndef __G_MEM_H__
#define __G_MEM_H__
+#include <glib/gslice.h>
#include <glib/gtypes.h>
G_BEGIN_DECLS
@@ -96,19 +97,6 @@ gboolean g_mem_is_system_malloc (void);
GLIB_VAR GMemVTable *glib_mem_profiler_table;
void g_mem_profile (void);
-/* slices - fast allocation/release of small memory blocks
- */
-gpointer g_slice_alloc (guint block_size);
-gpointer g_slice_alloc0 (guint block_size);
-void g_slice_free1 (guint block_size,
- gpointer mem_block);
-void g_slice_free_chain (guint block_size,
- gpointer mem_chain,
- guint next_offset);
-#define g_slice_new(type) ((type*) g_slice_alloc (sizeof (type)))
-#define g_slice_new0(type) ((type*) g_slice_alloc0 (sizeof (type)))
-#define g_slice_free(type,mem) g_slice_free1 (sizeof (type), mem)
-
/* deprecated memchunks and allocators */
#if !defined G_DISABLE_DEPRECATED || 1