mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 06:23:39 +00:00
runtime: use a specialized runtime panic function
This specifically fixes unix alloc(): previously when allocation fails it would (recursively) call alloc() again to create an interface due to lacking escape analysis. Also, all other cases shouldn't try to allocate just because something bad happens at runtime. TODO: implement escape analysis.
This commit is contained in:
@@ -48,7 +48,7 @@ func abort() {
|
||||
func alloc(size uintptr) unsafe.Pointer {
|
||||
buf := _Cfunc_calloc(1, size)
|
||||
if buf == nil {
|
||||
panic("cannot allocate memory")
|
||||
runtimePanic("cannot allocate memory")
|
||||
}
|
||||
return buf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user