v2 / vlib / builtin / vgc_notd_vgc.c.v
48 lines · 36 sloc · 1004 bytes · 9ec03736aea607c3df09fb8992aaab4d11ddc4dc
Raw
1module builtin
2
3// Stub declarations for VGC functions, so that V does not error
4// because of the missing definitions in $if vgc ? { } blocks.
5// Note: they will NOT be called, since calls to them are wrapped with `$if vgc ? { }`.
6
7fn vgc_malloc(n usize) voidptr {
8 return unsafe { nil }
9}
10
11fn vgc_malloc_noscan(n usize) voidptr {
12 return unsafe { nil }
13}
14
15fn vgc_malloc_typed_opts(n usize, ptrmap u64, ptr_words u8, zero_fill bool) voidptr {
16 return unsafe { nil }
17}
18
19fn vgc_malloc_noscan_opts(n usize, zero_fill bool) voidptr {
20 return unsafe { nil }
21}
22
23fn vgc_memdup(src voidptr, n isize) voidptr {
24 return unsafe { nil }
25}
26
27fn vgc_memdup_noscan(src voidptr, n isize) voidptr {
28 return unsafe { nil }
29}
30
31fn vgc_realloc(old_ptr voidptr, new_size usize) voidptr {
32 return unsafe { nil }
33}
34
35fn vgc_calloc(n usize) voidptr {
36 return unsafe { nil }
37}
38
39fn vgc_free(ptr voidptr) {
40}
41
42fn vgc_heap_usage() (usize, usize, usize, usize, usize) {
43 return 0, 0, 0, 0, 0
44}
45
46fn vgc_memory_use() usize {
47 return 0
48}
49