mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 21:13:39 +00:00
26 lines
421 B
Go
26 lines
421 B
Go
// +build nintendoswitch
|
|
|
|
// +build gc.conservative gc.leaking
|
|
|
|
package runtime
|
|
|
|
const heapSize = 0x2000000 * 16 // Default by libnx
|
|
|
|
var (
|
|
heapStart = uintptr(0)
|
|
heapEnd = uintptr(0)
|
|
)
|
|
|
|
//export setHeapSize
|
|
func setHeapSize(addr *uintptr, length uint64) uint64
|
|
|
|
func preinit() {
|
|
setHeapSize(&heapStart, heapSize)
|
|
|
|
if heapStart == 0 {
|
|
runtimePanic("failed to allocate heap")
|
|
}
|
|
|
|
heapEnd = heapStart + heapSize
|
|
}
|