next up previous contents
Next: String handling functions Up: GLib Previous: Doubly linked lists   Contents

Memory allocation

Only a few memory allocation functions provided by the GLib are used in the Osiris. These are:

gpointer  g_malloc   (gulong size);
gpointer  g_realloc  (gpointer mem,
                      gulong size);
void      g_free     (gpointer mem);

The first one allocates the memory of size size (in bytes) and returns the pointer to this memory. It is similar to the standard C library function malloc() but much safer (malloc() could be buggy on some systems).

The second one is similar to realloc() and it does the same things.

And the last one is to free the memory, allocated by two previous functions.



Igor Wojnicki 2001-02-21