MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / alloc

Function alloc

plugins/ast/golang/main.go:50–58  ·  view source on GitHub ↗

go:wasmexport alloc

(n uint32)

Source from the content-addressed store, hash-verified

48
49//go:wasmexport alloc
50func alloc(n uint32) uint32 {
51 if n == 0 {
52 return 0
53 }
54 b := make([]byte, n)
55 ptr := uint32(uintptr(unsafe.Pointer(&b[0])))
56 keep[ptr] = b
57 return ptr
58}
59
60//go:wasmexport dealloc
61func dealloc(ptr uint32, _ uint32) {

Callers 1

reportFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected