tinygo/src/runtime/arch_avr.go
Ayke van Laethem 9181f2d4ce
runtime: add "end of heap" to detect out of memory
This can be used in the future to trigger garbage collection. For now,
it provides a more useful error message in case the heap is completely
filled up.
2018-11-17 15:33:32 +01:00

29 строки
491 Б
Go

// +build avr
package runtime
import (
"unsafe"
)
const GOARCH = "avr"
// The bitness of the CPU (e.g. 8, 32, 64).
const TargetBits = 8
//go:extern _heap_start
var heapStartSymbol unsafe.Pointer
//go:extern _heap_end
var heapEndSymbol unsafe.Pointer
var (
heapStart = uintptr(unsafe.Pointer(&heapStartSymbol))
heapEnd = uintptr(unsafe.Pointer(&heapEndSymbol))
)
// Align on a word boundary.
func align(ptr uintptr) uintptr {
// No alignment necessary on the AVR.
return ptr
}