gmem.h File Reference

API published in:
API deprecated in:


#include <_ansi.h>
#include <glib/gtypes.h>

Go to the source code of this file.


Data Structures

struct   _GMemVTable

Defines

#define  G_MEM_ALIGN   GLIB_SIZEOF_LONG
#define  g_new(struct_type, n_structs)   ((struct_type *) g_malloc (((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
#define  g_new0(struct_type, n_structs)   ((struct_type *) g_malloc0 (((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
#define  g_renew(struct_type, mem, n_structs)   ((struct_type *) g_realloc ((mem), ((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
#define  g_try_new(struct_type, n_structs)   ((struct_type *) g_try_malloc (((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
#define  g_try_new0(struct_type, n_structs)   ((struct_type *) g_try_malloc0 (((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
#define  g_try_renew(struct_type, mem, n_structs)   ((struct_type *) g_try_realloc ((mem), ((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
#define  g_mem_chunk_create(type, pre_alloc, alloc_type)
#define  g_chunk_new(type, chunk)
#define  g_chunk_new0(type, chunk)
#define  g_chunk_free(mem, mem_chunk)
#define  G_ALLOC_ONLY   1
#define  G_ALLOC_AND_FREE   2
#define  G_ALLOCATOR_LIST   (1)
#define  G_ALLOCATOR_SLIST   (2)
#define  G_ALLOCATOR_NODE   (3)

Typedefs

typedef typedefG_BEGIN_DECLS
struct _GMemVTable 
GMemVTable
typedef _GAllocator  GAllocator
typedef _GMemChunk  GMemChunk

Functions

IMPORT_C gpointer  g_malloc (gulong n_bytes) G_GNUC_MALLOC
IMPORT_C gpointer  g_malloc0 (gulong n_bytes) G_GNUC_MALLOC
IMPORT_C gpointer  g_realloc (gpointer mem, gulong n_bytes) G_GNUC_WARN_UNUSED_RESULT
IMPORT_C void  g_free (gpointer mem)
IMPORT_C gpointer  g_try_malloc (gulong n_bytes) G_GNUC_MALLOC
IMPORT_C gpointer  g_try_malloc0 (gulong n_bytes) G_GNUC_MALLOC
IMPORT_C gpointer  g_try_realloc (gpointer mem, gulong n_bytes) G_GNUC_WARN_UNUSED_RESULT
IMPORT_C void  g_mem_set_vtable (GMemVTable *vtable)
IMPORT_C gboolean  g_mem_is_system_malloc (void)
IMPORT_C void  g_mem_profile (void)
IMPORT_C GMemChunk g_mem_chunk_new (const gchar *name, gint atom_size, gulong area_size, gint type)
IMPORT_C void  g_mem_chunk_destroy (GMemChunk *mem_chunk)
IMPORT_C gpointer  g_mem_chunk_alloc (GMemChunk *mem_chunk)
IMPORT_C gpointer  g_mem_chunk_alloc0 (GMemChunk *mem_chunk)
IMPORT_C void  g_mem_chunk_free (GMemChunk *mem_chunk, gpointer mem)
IMPORT_C void  g_mem_chunk_clean (GMemChunk *mem_chunk)
IMPORT_C void  g_mem_chunk_reset (GMemChunk *mem_chunk)
IMPORT_C void  g_mem_chunk_print (GMemChunk *mem_chunk)
IMPORT_C void  g_mem_chunk_info (void)
IMPORT_C void  g_blow_chunks (void)
IMPORT_C GAllocator g_allocator_new (const gchar *name, guint n_preallocs)
IMPORT_C void  g_allocator_free (GAllocator *allocator)

Variables

GLIB_VAR gboolean  g_mem_gc_friendly
GLIB_VAR GMemVTable glib_mem_profiler_table

Define Documentation

#define G_ALLOC_AND_FREE   2
 
#define G_ALLOC_ONLY   1
 
#define G_ALLOCATOR_LIST   (1)
 
#define G_ALLOCATOR_NODE   (3)
 
#define G_ALLOCATOR_SLIST   (2)
 
#define g_chunk_free mem,
mem_chunk   ) 
 

Value:

G_STMT_START { \
  g_mem_chunk_free ((mem_chunk), (mem)); \
} G_STMT_END
#define g_chunk_new type,
chunk   ) 
 

Value:

( \
  (type *) g_mem_chunk_alloc (chunk) \
)
#define g_chunk_new0 type,
chunk   ) 
 

Value:

( \
  (type *) g_mem_chunk_alloc0 (chunk) \
)
#define G_MEM_ALIGN   GLIB_SIZEOF_LONG
 
#define g_mem_chunk_create type,
pre_alloc,
alloc_type   ) 
 

Value:

( \
  g_mem_chunk_new (#type " mem chunks (" #pre_alloc ")", \
                   sizeof (type), \
                   sizeof (type) * (pre_alloc), \
                   (alloc_type)) \
)
#define g_new struct_type,
n_structs   )     ((struct_type *) g_malloc (((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
 
#define g_new0 struct_type,
n_structs   )     ((struct_type *) g_malloc0 (((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
 
#define g_renew struct_type,
mem,
n_structs   )     ((struct_type *) g_realloc ((mem), ((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
 
#define g_try_new struct_type,
n_structs   )     ((struct_type *) g_try_malloc (((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
 
#define g_try_new0 struct_type,
n_structs   )     ((struct_type *) g_try_malloc0 (((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
 
#define g_try_renew struct_type,
mem,
n_structs   )     ((struct_type *) g_try_realloc ((mem), ((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
 

Typedef Documentation

typedef struct _GAllocator GAllocator
 
typedef struct _GMemChunk GMemChunk
 
typedef typedefG_BEGIN_DECLS struct _GMemVTable GMemVTable
 

Function Documentation

IMPORT_C void g_allocator_free GAllocator allocator  ) 
 
IMPORT_C GAllocator* g_allocator_new const gchar name,
guint  n_preallocs
 
IMPORT_C void g_blow_chunks void   ) 
 
IMPORT_C void g_free gpointer  mem  ) 
 
IMPORT_C gpointer g_malloc gulong  n_bytes  ) 
 
IMPORT_C gpointer g_malloc0 gulong  n_bytes  ) 
 
IMPORT_C gpointer g_mem_chunk_alloc GMemChunk mem_chunk  ) 
 
IMPORT_C gpointer g_mem_chunk_alloc0 GMemChunk mem_chunk  ) 
 
IMPORT_C void g_mem_chunk_clean GMemChunk mem_chunk  ) 
 
IMPORT_C void g_mem_chunk_destroy GMemChunk mem_chunk  ) 
 
IMPORT_C void g_mem_chunk_free GMemChunk mem_chunk,
gpointer  mem
 
IMPORT_C void g_mem_chunk_info void   ) 
 
IMPORT_C GMemChunk* g_mem_chunk_new const gchar name,
gint  atom_size,
gulong  area_size,
gint  type
 
IMPORT_C void g_mem_chunk_print GMemChunk mem_chunk  ) 
 
IMPORT_C void g_mem_chunk_reset GMemChunk mem_chunk  ) 
 
IMPORT_C gboolean g_mem_is_system_malloc void   ) 
 
IMPORT_C void g_mem_profile void   ) 
 
IMPORT_C void g_mem_set_vtable GMemVTable vtable  ) 
 
IMPORT_C gpointer g_realloc gpointer  mem,
gulong  n_bytes
 
IMPORT_C gpointer g_try_malloc gulong  n_bytes  ) 
 
IMPORT_C gpointer g_try_malloc0 gulong  n_bytes  ) 
 
IMPORT_C gpointer g_try_realloc gpointer  mem,
gulong  n_bytes
 

Variable Documentation

GLIB_VAR gboolean g_mem_gc_friendly
 
GLIB_VAR GMemVTable* glib_mem_profiler_table
 

Copyright © Nokia Corporation 2001-2008
Back to top