harec

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

commit e8aeb7e6caef61feb7379a9dbd047cad95315226
parent e4bb3330fdba3c5f6e0025072ed7babd8e7dffa4
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Thu,  4 Feb 2021 18:18:28 -0500

rt: realloc: don't reallocate if s == n

Diffstat:
Mrt/malloc.ha | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rt/malloc.ha b/rt/malloc.ha @@ -155,7 +155,7 @@ export fn realloc(_p: nullable *void, n: size) nullable *void = { let p = _p: *void; let bsize = (p: uintptr - size(size): uintptr): *size; let s = *bsize; - if (s > n) { + if (s >= n) { return p; };