Implements calloc.

This commit is contained in:
waj334
2022-10-30 14:17:09 -05:00
committed by Ron Evans
parent 580fd490a5
commit ad544b5133
+6
View File
@@ -42,6 +42,12 @@ func libc_malloc(size uintptr) unsafe.Pointer {
return alloc(size, nil)
}
//export calloc
func libc_calloc(nmemb, size uintptr) unsafe.Pointer {
// No difference between calloc and malloc.
return libc_malloc(nmemb * size)
}
//export free
func libc_free(ptr unsafe.Pointer) {
free(ptr)