Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/runtime/baremetal.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ func growHeap() bool {
return false
}

//export malloc
//export tinygo_malloc
func libc_malloc(size uintptr) unsafe.Pointer {
// Note: this zeroes the returned buffer which is not necessary.
// The same goes for bytealg.MakeNoZero.
return alloc(size, nil)
}

//export calloc
//export tinygo_calloc
func libc_calloc(nmemb, size uintptr) unsafe.Pointer {
// No difference between calloc and malloc.
return libc_malloc(nmemb * size)
}

//export free
//export tinygo_free
func libc_free(ptr unsafe.Pointer) {
free(ptr)
}
Expand Down