This is the mail archive of the guile@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] |
Heres an idea I just came up with, that I thought I would like to test in the open. Studies on memory allocation behaviour (as I understand the matter) that most object either die very young, or live for considerable amounts of time. This is the motivation behind generational collectors. Once an object has reached a certain age, it is moved to an area less frequently scanned, since the likelyhood that it will need collection has dropped considerably. Unfortunately, this is not (immediately) available to us, since we cannot move objects around. But suppose we defined a smob (or some other appropriate structure) that would act as generation marker. It would contain two slots, a generation name (a number) and an arbitrary value. All normal objects are considered as belonging to generation zero. Each of the higher generations would have an associated count, determining how many collections of the previous generation (or the zero generation) should have happened before scanning this generation. When the collector runs, it would start by scanning the usual root set. When it encounters a generation object of a generation not yet ready, it would simply skip it, not touching the set of objects hanging of the value slot. Some trickery in the marking process would be necessary to allow higher-generation objects to remain appearing alive during "lower" collections, but this should be possible to solve. The facility would require users to actively promote objects to higher-generation status, but in many programs I would expect it to be possible to foretell at least some of the structures which will grow large and live long. ---------------------------+-------------------------------------------------- Christian Lynbech | Telebit Communications A/S Fax: +45 8628 8186 | Fabrik 11, DK-8260 Viby J Phone: +45 8628 8177 + 28 | email: chl@tbit.dk --- URL: http://www.telebit.dk ---------------------------+-------------------------------------------------- Hit the philistines three times over the head with the Elisp reference manual. - petonic@hal.com (Michael A. Petonic)