all: make garbage collector configurable

This commit is contained in:
Ayke van Laethem
2018-11-17 15:01:30 +01:00
parent ecb4742316
commit c220c140ef
3 changed files with 23 additions and 3 deletions
+8 -2
View File
@@ -1,5 +1,11 @@
// +build gc.dumb
package runtime
// This GC implementation is the simplest useful memory allocator possible: it
// only allocates memory and never frees it. For some constrained systems, it
// may be the only memory allocator possible.
import (
"unsafe"
)
@@ -22,11 +28,11 @@ func alloc(size uintptr) unsafe.Pointer {
}
func free(ptr unsafe.Pointer) {
// TODO: use a GC
// Memory is never freed.
}
func GC() {
// Unimplemented.
// No-op.
}
func KeepAlive(x interface{}) {