harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 9fc2f079bbef9ac7491174b547b146b572a0f876
parent 319ed2a3bac70ce5fef7e7f62abcbfa26f3151c4
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 22 Jan 2021 13:14:01 -0500

rt: drop must_malloc references

Diffstat:
Mrt/malloc.ha | 9+--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/rt/malloc.ha b/rt/malloc.ha @@ -116,7 +116,7 @@ fn list_from_block(s: size, p: uintptr) nullable *void = { return (p + WASTE: uintptr + WORD: uintptr): *void; }; -// Frees a pointer previously allocated with [malloc] or [must_malloc]. +// Frees a pointer previously allocated with [malloc]. export @symbol("rt.free") fn free_(_p: nullable *void) void = { if (_p != null: nullable *void) { let p = _p: *void; @@ -170,10 +170,3 @@ export fn realloc(_p: nullable *void, n: size) nullable *void = { return new; }; - -// Like [realloc], but aborts the program if there is insufficient memory. -export fn must_realloc(p: nullable *void, n: size) *void = { - let new = realloc(p, n); - assert(new != null: nullable *void, "out of memory"); - return new: *void; -};