blob: 8567e6a98ab192ad58af78b9a372adcee5ddaea9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include <glib.h>
#include <stdio.h>
int main (void) {
GSList *sl=NULL;
GAllocator *myalloc=NULL;
g_mem_set_vtable(glib_mem_profiler_table);
//-- allocator hack
myalloc = g_allocator_new("myAllocator", 128);
g_slist_push_allocator(myalloc);
sl = g_slist_prepend(NULL,(gpointer)2);
g_slist_free(sl);
//-- allocator hack
g_slist_pop_allocator();
g_allocator_free(myalloc);
g_blow_chunks();
g_mem_profile();
return 0;
}
|