runtime (gc): add garbage collector that uses an external allocator

This commit is contained in:
Jaden Weiss
2020-03-24 19:39:04 -04:00
committed by Ayke
parent 57320c0922
commit 62e78c0a26
11 changed files with 683 additions and 25 deletions
+14
View File
@@ -0,0 +1,14 @@
// +build darwin linux,!baremetal freebsd,!baremetal
// +build gc.conservative gc.leaking
package runtime
const heapSize = 1 * 1024 * 1024 // 1MB to start
var heapStart, heapEnd uintptr
func preinit() {
heapStart = uintptr(malloc(heapSize))
heapEnd = heapStart + heapSize
}