Closed GoogleCodeExporter closed 9 years ago
Thanks for the report. Excellent detail. This is the same as Issue #39.
This issue is actually a well-known problem of some kinds of garbage
collectors. I attempted to solve issue #39 once by using a temporary anchor
(set the first new object as a temporary root), but that solution does not work
well for the recursive function calls found in the obj_loadFromImg() call tree.
The next obvious solution is to create a list of temporary roots and append
each new object until the final link occurs. This is difficult for 2 reasons:
creating a list to hold the temporary roots requires more RAM; finding all the
places in the code where the anchor list needs to be made is not easy.
I am open to recommendations for fixing this.
Original comment by dwhall...@gmail.com
on 8 Jun 2010 at 10:09
How did you implement the temporary anchor?
Original comment by i...@moticon.de
on 9 Jun 2010 at 8:46
The attached patch file does not solve the issue. But it does show how I tried
to solve this issue using a temporary anchor. The patch applies against r492.
Original comment by dwhall...@gmail.com
on 9 Jun 2010 at 12:23
Attachments:
The attached file is a proposal against r496.
The main idea is the following:
There is a fixed temporary root c array.
Each heap_getChunkImpl saves the returned pointer in this array.
The array is cleaned inside the interpreter loop.
But there is some need for optimation:
For example tuple_loadFromImg can create a variable size of elements,
causing an overflow in the c array.
The paired functions heap_beginAlloc, heap_endAlloc, should avoid
an overflow.
Original comment by i...@moticon.de
on 10 Jun 2010 at 5:21
Attachments:
Michael thank you for your patches. I knew an array of temp anchors was the
way to go, but your code showed me how to push/pop the index into the array.
That was the idea I was missing. I've mainlined Issue #39, so you might want
to check that it fixes your issue. Please reply on the maillist or issue #39
if there is any more trouble.
Original comment by dwhall...@gmail.com
on 25 Jul 2010 at 10:40
Original issue reported on code.google.com by
i...@moticon.de
on 8 Jun 2010 at 11:31