File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,36 +7,6 @@ import (
77 "unsafe"
88)
99
10- //go:extern _heap_start
11- var heapStartSymbol [0 ]byte
12-
13- //go:extern _heap_end
14- var heapEndSymbol [0 ]byte
15-
16- //go:extern _globals_start
17- var globalsStartSymbol [0 ]byte
18-
19- //go:extern _globals_end
20- var globalsEndSymbol [0 ]byte
21-
22- //go:extern _stack_top
23- var stackTopSymbol [0 ]byte
24-
25- var (
26- heapStart = uintptr (unsafe .Pointer (& heapStartSymbol ))
27- heapEnd = uintptr (unsafe .Pointer (& heapEndSymbol ))
28- globalsStart = uintptr (unsafe .Pointer (& globalsStartSymbol ))
29- globalsEnd = uintptr (unsafe .Pointer (& globalsEndSymbol ))
30- stackTop = uintptr (unsafe .Pointer (& stackTopSymbol ))
31- )
32-
33- // growHeap tries to grow the heap size. It returns true if it succeeds, false
34- // otherwise.
35- func growHeap () bool {
36- // On baremetal, there is no way the heap can be grown.
37- return false
38- }
39-
4010//export malloc
4111func libc_malloc (size uintptr ) unsafe.Pointer {
4212 // Note: this zeroes the returned buffer which is not necessary.
Original file line number Diff line number Diff line change 1+ //go:build baremetal
2+
3+ package runtime
4+
5+ import "unsafe"
6+
7+ //go:extern _heap_start
8+ var heapStartSymbol [0 ]byte
9+
10+ //go:extern _heap_end
11+ var heapEndSymbol [0 ]byte
12+
13+ //go:extern _globals_start
14+ var globalsStartSymbol [0 ]byte
15+
16+ //go:extern _globals_end
17+ var globalsEndSymbol [0 ]byte
18+
19+ //go:extern _stack_top
20+ var stackTopSymbol [0 ]byte
21+
22+ var (
23+ heapStart = uintptr (unsafe .Pointer (& heapStartSymbol ))
24+ heapEnd = uintptr (unsafe .Pointer (& heapEndSymbol ))
25+ globalsStart = uintptr (unsafe .Pointer (& globalsStartSymbol ))
26+ globalsEnd = uintptr (unsafe .Pointer (& globalsEndSymbol ))
27+ stackTop = uintptr (unsafe .Pointer (& stackTopSymbol ))
28+ )
29+
30+ // growHeap tries to grow the heap size. It returns true if it succeeds, false
31+ // otherwise.
32+ func growHeap () bool {
33+ // On baremetal, there is no way the heap can be grown.
34+ return false
35+ }
You can’t perform that action at this time.
0 commit comments