glib.Allocator.Allocator Class Reference

List of all members.

Detailed Description

Description Prior to 2.10, GAllocator was used as an efficient way to allocate small pieces of memory for use with the GList, GSList and GNode data structures.

Since 2.10, it has been completely replaced by the slice allocator and deprecated.


Public Member Functions

GAllocatorgetAllocatorStruct ()
 this (GAllocator *gAllocator)
 Sets our main struct and passes it to the parent class.
 this (char[] name, uint nPreallocs)
 Warning g_allocator_new has been deprecated since version 2.10 and should not be used in newly-written code.
void free ()
 Warning g_allocator_free has been deprecated since version 2.10 and should not be used in newly-written code.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GAllocatorgAllocator
 the main Gtk struct


Constructor & Destructor Documentation

glib.Allocator.Allocator.this ( GAllocator gAllocator  ) 

Sets our main struct and passes it to the parent class.

glib.Allocator.Allocator.this ( char[]  name,
uint  nPreallocs 
)

Warning g_allocator_new has been deprecated since version 2.10 and should not be used in newly-written code.

Use the slice allocator instead Creates a new GAllocator. name: the name of the GAllocator. This name is used to set the name of the GMemChunk used by the GAllocator, and is only used for debugging. n_preallocs: the number of elements in each block of memory allocated. Larger blocks mean less calls to g_malloc(), but some memory may be wasted. (GLib uses 128 elements per block by default.) The value must be between 1 and 65535. Returns: a new GAllocator.


Member Function Documentation

void glib.Allocator.Allocator.free (  ) 

Warning g_allocator_free has been deprecated since version 2.10 and should not be used in newly-written code.

Use the slice allocator instead Frees all of the memory allocated by the GAllocator. allocator: a GAllocator.

GAllocator* glib.Allocator.Allocator.getAllocatorStruct (  ) 

void* glib.Allocator.Allocator.getStruct (  )  [protected]

the main Gtk struct as a void*


Member Data Documentation

GAllocator* glib.Allocator.Allocator.gAllocator [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo