1
0
Fork 0
forked from judah/xx
xx/mem/mem_wasm.go
2026-01-31 13:26:06 -07:00

30 lines
430 B
Go

//go:build wasm
package mem
import (
"runtime"
"unsafe"
)
func reserve(total_address_space uintptr) ([]byte, error) {
data := make([]byte, total_address_space)
p.Pin(unsafe.SliceData(data))
return data, nil
}
func release(_ []byte) error {
p.Unpin()
return nil
}
func commit(_ []byte, _ Access) error {
return nil
}
func decommit(committed []byte) (err error) {
clear(committed)
return nil
}
var p runtime.Pinner