1 | module builtin |
2 | |
3 | // Just define the C functions, so that V does not error because of the missing definitions. |
4 | |
5 | // Note: they will NOT be used, since calls to them are wrapped with `$if gcboehm ? { }` |
6 | |
7 | fn C.GC_MALLOC(n usize) voidptr |
8 | |
9 | fn C.GC_MALLOC_ATOMIC(n usize) voidptr |
10 | |
11 | fn C.GC_MALLOC_UNCOLLECTABLE(n usize) voidptr |
12 | |
13 | fn C.GC_REALLOC(ptr voidptr, n usize) voidptr |
14 | |
15 | fn C.GC_FREE(ptr voidptr) |
16 | |
17 | fn C.GC_get_heap_usage_safe(pheap_size &usize, pfree_bytes &usize, punmapped_bytes &usize, pbytes_since_gc &usize, ptotal_bytes &usize) |
18 | |
19 | fn C.GC_get_memory_use() usize |
20 | |
21 | // provide an empty function when manual memory management is used |
22 | // to simplify leak detection |
23 | // |
24 | pub fn gc_check_leaks() {} |