mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-11 23:19:30 +00:00
runtime: make out-of-memory failures fatal
Match the Go runtime by terminating instead of unwinding when an allocator exhausts the heap. Recovering an OOM can leave allocator locks held and cannot safely continue when the panic path itself needs memory.
This commit is contained in:
@@ -87,7 +87,7 @@ func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer {
|
||||
gcResumeWorld()
|
||||
gcLock.Unlock()
|
||||
if ptr == nil {
|
||||
runtimePanic("gc: out of memory")
|
||||
runtimeFatal("gc: out of memory")
|
||||
}
|
||||
|
||||
return ptr
|
||||
|
||||
Reference in New Issue
Block a user