vile / bench / memory / gc.c.v
15 lines · 12 sloc · 382 bytes · 76646891b77a3d5c6af4a1e42b122cd61dc1654b
Raw
1module main
2
3#flag -I @VEXEROOT/thirdparty/libgc/include
4#include "@VMODROOT/bench/memory/gc_stats.h"
5
6fn C.vile_memory_gc_no() uint
7
8// Read a synchronized collector snapshot outside the measured call. Its C-stack
9// scratch storage introduces no allocation; GC remains enabled throughout.
10fn collections() u64 {
11 $if gcboehm ? {
12 return u64(C.vile_memory_gc_no())
13 }
14 return 0
15}
16