mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-03-15 20:56:07 +01:00
Remove memory intrinsics
This commit is contained in:
parent
9270f52e6b
commit
1e97275cf2
5 changed files with 15 additions and 19 deletions
|
|
@ -15,9 +15,9 @@ function allocate(size: I32, align: I32): I32 = (
|
|||
let alignedPtr = std.alignUp(HEAD_PTR, align);
|
||||
let newHeadPtr = alignedPtr + size;
|
||||
|
||||
if newHeadPtr > __memory_size() then (
|
||||
if newHeadPtr > std.rt.memorySize() then (
|
||||
// 16 pages, very arbitrary.
|
||||
let result = __memory_grow(16_I32);
|
||||
let result = std.rt.memoryGrow(16_I32);
|
||||
// If allocation failed we get -1. We don't have negative numbers yet, lol.
|
||||
if result > 4294967295_I32 then (
|
||||
std.abort("failed to grow memory");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue