mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-24 12:11:50 +00:00
Implement a mechanism to realloc array buffers; Trap when trying to allocate more than max size; Test allocators in CI
This commit is contained in:
@ -347,9 +347,7 @@ export function allocate_memory(request: usize): usize {
|
||||
* a hard-coded limit on the maximum allocation size because of the way this
|
||||
* allocator works.
|
||||
*/
|
||||
if (request > MAX_ALLOC - HEADER_SIZE) {
|
||||
return 0;
|
||||
}
|
||||
if (request > MAX_ALLOC - HEADER_SIZE) unreachable();
|
||||
|
||||
/*
|
||||
* Initialize our global state if this is the first call to "malloc". At the
|
||||
|
Reference in New Issue
Block a user