This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Idea: returning unused cells to the pool of free cells


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]