...
Source file
src/runtime/mem_wasm.go
Documentation: runtime
1
2
3
4
5 package runtime
6
7 import "unsafe"
8
9 func sbrk(n uintptr) unsafe.Pointer {
10 bl := bloc
11 n = memRound(n)
12 if bl+n > blocMax {
13 grow := (bl + n - blocMax) / physPageSize
14 size := growMemory(int32(grow))
15 if size < 0 {
16 return nil
17 }
18 resetMemoryDataView()
19 blocMax = bl + n
20 }
21 bloc += n
22 return unsafe.Pointer(bl)
23 }
24
25
26 func growMemory(pages int32) int32
27 func currentMemory() int32
28
View as plain text