v / vlib / builtin
Raw file | 24 loc (14 sloc) | 521 bytes | Latest commit hash 36ec47cd2
1module 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
7fn C.GC_MALLOC(n usize) voidptr
8
9fn C.GC_MALLOC_ATOMIC(n usize) voidptr
10
11fn C.GC_MALLOC_UNCOLLECTABLE(n usize) voidptr
12
13fn C.GC_REALLOC(ptr voidptr, n usize) voidptr
14
15fn C.GC_FREE(ptr voidptr)
16
17fn C.GC_get_heap_usage_safe(pheap_size &usize, pfree_bytes &usize, punmapped_bytes &usize, pbytes_since_gc &usize, ptotal_bytes &usize)
18
19fn C.GC_get_memory_use() usize
20
21// provide an empty function when manual memory management is used
22// to simplify leak detection
23//
24pub fn gc_check_leaks() {}