diff --git a/src/runtime/baremetal.go b/src/runtime/baremetal.go index b91fdb29..c4e44b7e 100644 --- a/src/runtime/baremetal.go +++ b/src/runtime/baremetal.go @@ -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)