[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DEFSTRUCT and reclaimable storage
- Subject: Re: DEFSTRUCT and reclaimable storage
- From: BAK at MIT-AI (William A. Kornfeld)
- Date: Sun ,30 Nov 80 22:06:00 EDT
[This msg principally meant for Lisp machine users but may be of
wider interest.]
There are a number of places in programs that I write in which I create
structures (ART-Q arrays) of specific types copiously and know when I am
finished with them. As such, it would take a load off the garbage
collector if I could indicate that specific instances could be reused
for structure instances to be created in the future.(*) The idea would
be that if the structure was defined as:
(DEFSTRUCT (FOO :RECLAIMABLE ...)
...)
a function of one argument named RECLAIM-FOO would be defined.
(RECLAIM-FOO <structure>) will add <structure> to a linked chain of
structures bound to the variable FOO-FREE-CHAIN. The linking is
accomplished by having a designated cell of the structure point to the
next instance. The function MAKE-FOO will be defined to first check if
there is an instance sitting on FOO-FREE-CHAIN and if so use that one
rather than consing a new one.
Any Lispm system hacker interested in implementing this? (I found
the code for DEFSTRUCT hard to grok.)
*
I realize that some people have a philosophical objection to doing
this. I don't want to get into a debate about it. If you're curious
I'll send you descriptions of the applications I have in mind for which
it would be an extremely useful facility.