glib/gmem.c (g_mem_is_system_malloc): Return !vtable_set.

docs/reference/glib/glib-sections.txt: Add g_mem_is_system_malloc.
This commit is contained in:
Matthias Clasen
2001-09-26 22:00:17 +00:00
parent 18190575f8
commit c7896e13d3
11 changed files with 44 additions and 7 deletions

View File

@@ -228,18 +228,19 @@ static gboolean vtable_set = FALSE;
*
* Checks whether the allocator used by g_malloc() is the system's
* malloc implementation. If it returns %TRUE memory allocated with
* malloc() can be used interchangeable with memory allocated using
* g_malloc(). This function is useful for avoiding an extra copy
* of allocated memory returned by a non-GLib-based API.
* <function>malloc()</function> can be used interchangeable with
* memory allocated using g_malloc(). This function is useful for
* avoiding an extra copy of allocated memory returned by a
* non-GLib-based API.
*
* A different allocator can be set using g_mem_set_vtable().
*
* Return value: if %TRUE, malloc() and g_malloc() can be mixed.
* Return value: if %TRUE, <function>malloc()</function> and g_malloc() can be mixed.
**/
gboolean
g_mem_is_system_malloc (void)
{
return vtable_set;
return !vtable_set;
}
void