This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Idea: returning unused cells to the pool of free cells
- To: Guile Mailing List <guile at sourceware dot cygnus dot com>
- Subject: Idea: returning unused cells to the pool of free cells
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Thu, 4 May 2000 11:04:54 +0200 (MEST)
Hi!
Maybe someone knows whether the following idea makes sense:
Sometimes in code you know that some cells that you have allocated will
definitely be unused again at some point. Up to now, there is no
possibility to actively return a cell to the pool of free cells. Imagine
a part of the code that in a loop continuously has to allocate a bunch of
cells, but it is known that only some of these will be kept. Without the
possibility to return cells, gc would be started over and over again,
scanning the whole heap and basically only returning those cells which
were known by the programmer to be free anyway. Generational gc will help
in this case, but it will still be worse performance wise: gc will
always also scan those cells that are to be kept, gc will always have to
scan the stack and gengc will also scan older generations from time to
time.
The cost of returning cells to the freelist will most probably be
comparable to the effort the gc has when it returns cells to the freelist,
thus it won't make a big difference if the gc encounters n free cells and
puts them into the freelist or if the code itself returns n free cells to
the pool.
Best regards
Dirk Herrmann