Re: [Gc] Creating stack-like memory containing GC roots
Christian Schafmeister <[email protected]> Wed, 23 Sep 2015 17:18:49 -0400
| Newsgroups | gmane.comp.programming.garbage-collection.boehmgc |
|---|---|
| Message-ID | <[email protected]> |
Thank you for responding! So popping a frame off the stack would involve memset’ing the memory of the frame to zeros? And I would allocate the memory using GC_malloc_uncollectable. I wouldn’t provide Boehm with any pointer to the top (moving end) of the stack. That would mean that the unused memory of the stack would be full of zeros but it would still be scanned by the GC. Will that not add significant overhead? I see how to make that work, I’m just concerned about the overhead. I could occasionally dynamically resize this stack if the amount of unused space becomes obscene... Best, .Chris. > On Sep 23, 2015, at 5:08 PM, Basile Starynkevitch <[email protected]> wrote: > > On 09/23/2015 09:52 PM, Christian Schafmeister wrote: >> I’ve written a Common Lisp compiler that uses LLVM as the backend and that interoperates with C++. >> >> I’m using the Boehm garbage collector and I need to create a stack alongside the regular C++ stack that holds GC roots. >> > > > > Just use a regular GC-ed zone, but don't forget to grow it (by copying it to a greater zone when needed) and to clear the popped values. Use offsets, not pointers, into that zone. > > Regards. > > -- > Basile STARYNKEVITCH http://starynkevitch.net/Basile/ > email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 > 8, rue de la Faiencerie, 92340 Bourg La Reine, France > *** opinions {are only mine, sont seulement les miennes} *** > _______________________________________________ bdwgc mailing list [email protected] https://lists.opendylan.org/mailman/listinfo/bdwgc