mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 06:53:40 +00:00
runtime: unify GC interface
Make sure every to-be-implemented GC can use the same interface. As a result, a 1MB chunk of RAM is allocated on Unix systems on init instead of allocating on demand.
This commit is contained in:
+2
-3
@@ -1,12 +1,11 @@
|
||||
// +build !linux
|
||||
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var heapptr = uintptr(unsafe.Pointer(&heapStart))
|
||||
// Ever-incrementing pointer: no memory is freed.
|
||||
var heapptr = heapStart
|
||||
|
||||
func alloc(size uintptr) unsafe.Pointer {
|
||||
// TODO: this can be optimized by not casting between pointers and ints so
|
||||
|
||||
Reference in New Issue
Block a user