github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/runtime/gc_none.go (about) 1 //go:build gc.none 2 3 package runtime 4 5 // This GC strategy provides no memory allocation at all. It can be useful to 6 // detect where in a program memory is allocated (via linker errors) or for 7 // targets that have far too little RAM even for the leaking memory allocator. 8 9 import ( 10 "unsafe" 11 ) 12 13 var gcTotalAlloc uint64 // for runtime.MemStats 14 var gcMallocs uint64 15 var gcFrees uint64 16 17 func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer 18 19 func realloc(ptr unsafe.Pointer, size uintptr) unsafe.Pointer 20 21 func free(ptr unsafe.Pointer) { 22 // Nothing to free when nothing gets allocated. 23 } 24 25 func GC() { 26 // Unimplemented. 27 } 28 29 func SetFinalizer(obj interface{}, finalizer interface{}) { 30 // Unimplemented. 31 } 32 33 func initHeap() { 34 // Nothing to initialize. 35 } 36 37 func setHeapEnd(newHeapEnd uintptr) { 38 // Nothing to do here, this function is never actually called. 39 }