[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH] Another small patch for runtime.c
From: |
Peter Bex |
Subject: |
[Chicken-hackers] [PATCH] Another small patch for runtime.c |
Date: |
Thu, 21 Jun 2012 20:50:21 +0200 |
User-agent: |
Mutt/1.4.2.3i |
Hi all,
While still chasing the bug(s?) found by Megane and Mario, I noticed
another small mistake in the memory handling of the GC. This one could
have actual consequences in practice. The out of memory check
does a calculation which is compared to a maximum memory endpoint.
This calculation is repeated later to really set the heap size, but
that second calculation includes an extra alignment. This alignment
adds up to 7 more bytes, which means there's a situation where we *just*
run out of memory, but the test won't flag it.
I tried to simplify the code to avoid similar bugs if this code is
changed in the future, by assigning first, then checking. It seems
so obvious, I'm scared I missed something :)
This ALSO doesn't fix any of the aforementioned bugs...
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth
0001-Fix-out-of-memory-check-so-it-includes-alignment-and.patch
Description: Text document
- [Chicken-hackers] [PATCH] Another small patch for runtime.c,
Peter Bex <=