hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit b528cdda99fe6c4121ad51dbfdcae4d049f551f1
parent ff699f57acb1d40e757243c12b103a62d8f3a21d
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 @@ -148,7 +148,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; };