[Coop] Convert System.CLRConfig to coop. (#8606)
[mono-project.git] / mono / utils / mono-publib.c
blob9dec4e76083ef1cc6f4a602619e3d4d7f1ebe708
1 /**
2 * \file
3 */
5 #include "config.h"
6 #include <mono/utils/mono-publib.h>
7 #include <glib.h>
9 void
10 mono_free (void *ptr)
12 g_free (ptr);
16 /**
17 * mono_set_allocator_vtable
18 * Make the runtime use the functions in \p vtable for allocating memory.
19 * The provided functions must have the same semantics of their libc's equivalents.
20 * \returns TRUE if the vtable was installed. FALSE if the version is incompatible.
22 mono_bool
23 mono_set_allocator_vtable (MonoAllocatorVTable* vtable)
25 if (vtable->version != MONO_ALLOCATOR_VTABLE_VERSION)
26 return FALSE;
27 GMemVTable g_mem_vtable = { vtable->malloc, vtable->realloc, vtable->free, vtable->calloc};
28 g_mem_set_vtable (&g_mem_vtable);
29 return TRUE;