File indexing completed on 2026-05-06 08:41:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef __G_ALLOCATOR_H__
0017 #define __G_ALLOCATOR_H__
0018
0019 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
0020 #error "Only <glib.h> can be included directly."
0021 #endif
0022
0023 #include <glib/gtypes.h>
0024
0025 G_BEGIN_DECLS
0026
0027 typedef struct _GAllocator GAllocator;
0028 typedef struct _GMemChunk GMemChunk;
0029
0030 #define G_ALLOC_ONLY 1
0031 #define G_ALLOC_AND_FREE 2
0032 #define G_ALLOCATOR_LIST 1
0033 #define G_ALLOCATOR_SLIST 2
0034 #define G_ALLOCATOR_NODE 3
0035
0036 #define g_chunk_new(type, chunk) ((type *) g_mem_chunk_alloc (chunk))
0037 #define g_chunk_new0(type, chunk) ((type *) g_mem_chunk_alloc0 (chunk))
0038 #define g_chunk_free(mem, mem_chunk) (g_mem_chunk_free (mem_chunk, mem))
0039 #define g_mem_chunk_create(type, x, y) (g_mem_chunk_new (NULL, sizeof (type), 0, 0))
0040
0041
0042 GLIB_DEPRECATED
0043 GMemChunk * g_mem_chunk_new (const gchar *name,
0044 gint atom_size,
0045 gsize area_size,
0046 gint type);
0047 GLIB_DEPRECATED
0048 void g_mem_chunk_destroy (GMemChunk *mem_chunk);
0049 GLIB_DEPRECATED
0050 gpointer g_mem_chunk_alloc (GMemChunk *mem_chunk);
0051 GLIB_DEPRECATED
0052 gpointer g_mem_chunk_alloc0 (GMemChunk *mem_chunk);
0053 GLIB_DEPRECATED
0054 void g_mem_chunk_free (GMemChunk *mem_chunk,
0055 gpointer mem);
0056 GLIB_DEPRECATED
0057 void g_mem_chunk_clean (GMemChunk *mem_chunk);
0058 GLIB_DEPRECATED
0059 void g_mem_chunk_reset (GMemChunk *mem_chunk);
0060 GLIB_DEPRECATED
0061 void g_mem_chunk_print (GMemChunk *mem_chunk);
0062 GLIB_DEPRECATED
0063 void g_mem_chunk_info (void);
0064 GLIB_DEPRECATED
0065 void g_blow_chunks (void);
0066
0067
0068 GLIB_DEPRECATED
0069 GAllocator * g_allocator_new (const gchar *name,
0070 guint n_preallocs);
0071 GLIB_DEPRECATED
0072 void g_allocator_free (GAllocator *allocator);
0073 GLIB_DEPRECATED
0074 void g_list_push_allocator (GAllocator *allocator);
0075 GLIB_DEPRECATED
0076 void g_list_pop_allocator (void);
0077 GLIB_DEPRECATED
0078 void g_slist_push_allocator (GAllocator *allocator);
0079 GLIB_DEPRECATED
0080 void g_slist_pop_allocator (void);
0081 GLIB_DEPRECATED
0082 void g_node_push_allocator (GAllocator *allocator);
0083 GLIB_DEPRECATED
0084 void g_node_pop_allocator (void);
0085
0086 G_END_DECLS
0087
0088 #endif