2021-03-20 16:16:36 +03:00
|
|
|
module builtin
|
|
|
|
|
|
|
|
#define GC_THREADS 1
|
|
|
|
|
2021-03-21 03:01:21 +03:00
|
|
|
$if windows {
|
|
|
|
#flag -I@VROOT/thirdparty/libgc/include
|
|
|
|
#flag -L@VROOT/thirdparty/libgc
|
|
|
|
}
|
|
|
|
|
2021-03-20 16:16:36 +03:00
|
|
|
#include <gc.h>
|
|
|
|
|
2021-03-21 05:31:06 +03:00
|
|
|
#flag linux -lgc
|
|
|
|
#flag darwin @VROOT/thirdparty/bdwgc/extra/.libs/gc.o
|
2021-03-20 16:16:36 +03:00
|
|
|
|
|
|
|
fn C.GC_MALLOC(n size_t) voidptr
|
|
|
|
|
|
|
|
fn C.GC_REALLOC(ptr voidptr, n size_t) voidptr
|
|
|
|
|
|
|
|
fn C.GC_FREE(ptr voidptr)
|
2021-03-21 05:31:06 +03:00
|
|
|
|
|
|
|
fn C.GC_set_find_leak(int)
|
|
|
|
|
|
|
|
// fn C.CHECK_LEAKS()
|
|
|
|
fn C.GC_gcollect()
|