mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 03:03:27 +00:00
Implements calloc.
This commit is contained in:
@@ -42,6 +42,12 @@ func libc_malloc(size uintptr) unsafe.Pointer {
|
|||||||
return alloc(size, nil)
|
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
|
//export free
|
||||||
func libc_free(ptr unsafe.Pointer) {
|
func libc_free(ptr unsafe.Pointer) {
|
||||||
free(ptr)
|
free(ptr)
|
||||||
|
|||||||
Reference in New Issue
Block a user