mirror of
https://github.com/fluencelabs/musl
synced 2025-04-24 14:52:13 +00:00
handle oom
This commit is contained in:
parent
3ce20a9f57
commit
ddb01fbf88
@ -1354,6 +1354,10 @@ function syscall_writev(fd, iov, iovcnt) {
|
||||
}
|
||||
|
||||
function syscall_brk(value) {
|
||||
if (value > heap_size_bytes) {
|
||||
print('brk failed: memsize: ' + heap_size_bytes + ' requested: ' + value);
|
||||
return -1;
|
||||
}
|
||||
if (value != 0)
|
||||
heap_end = value;
|
||||
return heap_end;
|
||||
|
Loading…
x
Reference in New Issue
Block a user