feat(c): Add Calloc func

This commit is contained in:
hackerchai
2024-08-07 16:45:17 +08:00
parent e6b4deb5c4
commit 753dcd3301

3
c/c.go
View File

@@ -79,6 +79,9 @@ func AllocaNew[T any]() *T { return nil }
//go:linkname Malloc C.malloc //go:linkname Malloc C.malloc
func Malloc(size uintptr) Pointer func Malloc(size uintptr) Pointer
//go:linkname Calloc C.calloc
func Calloc(num uintptr, size uintptr) Pointer
//go:linkname Free C.free //go:linkname Free C.free
func Free(ptr Pointer) func Free(ptr Pointer)