all: replace _extern_* workaround with //go:extern pragma

This commit is contained in:
Ayke van Laethem
2018-09-21 14:28:47 +02:00
parent 2ca2220e44
commit 3c22f5731c
3 changed files with 69 additions and 18 deletions
+4 -4
View File
@@ -6,10 +6,10 @@ import (
"unsafe"
)
var (
_extern__heap_start unsafe.Pointer // defined by the linker
heapptr = uintptr(unsafe.Pointer(&_extern__heap_start))
)
//go:extern _heap_start
var heapStart unsafe.Pointer
var heapptr = uintptr(unsafe.Pointer(&heapStart))
func alloc(size uintptr) unsafe.Pointer {
// TODO: this can be optimized by not casting between pointers and ints so