[docs] Enable documentation for utils.
[mono.git] / mono / utils / mono-publib.c
1 /**
2  * \file
3  */
4
5 #include "config.h"
6 #include <mono/utils/mono-publib.h>
7 #include <glib.h>
8
9 void
10 mono_free (void *ptr)
11 {
12         g_free (ptr);
13 }
14
15
16 /**
17  * mono_set_allocator_vtable
18  *
19  * Make the runtime use the functions in @vtable for allocating memory.
20  * The provided functions must have the same semantics of their libc's equivalents.
21  *
22  * @return TRUE is the vtable was installed. FALSE if the version is incompatible.
23  */
24 mono_bool
25 mono_set_allocator_vtable (MonoAllocatorVTable* vtable)
26 {
27         if (vtable->version != MONO_ALLOCATOR_VTABLE_VERSION)
28                 return FALSE;
29         GMemVTable g_mem_vtable = { vtable->malloc, vtable->realloc, vtable->free, vtable->calloc};
30         g_mem_set_vtable (&g_mem_vtable);
31         return TRUE;
32 }