[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to free the memory occupied by the instance object?
- To: firstname.lastname@example.org
- Subject: Re: How to free the memory occupied by the instance object?
- From: email@example.com (Lawrence G. Mayka)
- Date: Tue, 26 Jul 1994 12:59:17 GMT
- In-reply-to: firstname.lastname@example.org's message of 26 Jul 1994 00:45:53 GMT
- Newsgroups: comp.lang.lisp.mcl
- Organization: AT&T Bell Laboratories, Naperville, Illinois, USA
- References: <email@example.com> <firstname.lastname@example.org>
- Sender: email@example.com (Netnews Administration)
In article <firstname.lastname@example.org> email@example.com (Richard Lynch) writes:
If you have created mac pointers [machine specific data structures], and
have stored them in slots, you need to be sure to dispose of them when
they are no longer needed.
For example, a window has a wptr slot that contains a WindowPtr [?] record
that can be passed to MacOS ToolBox trap calls (#_xxx (wptr <window>)).
When a window is closed, its wptr is disposed.
The upshot is, pointers and handles are NEVER disposed automatically; you
must take care of them yourself if you create them.
All the MCL builtin code, and [almost for sure] all the user-contributed
code do this properly, but it's up to you to do it properly for your own
mac pointers such as PICT, SND , etc handles.
I thought that MCL offered a (possibly undocumented) finalization
capability, whereby one can specify a function to be run when a given
object (or perhaps any object of a given class) is about to be
garbage-collected. If so, one could specify a finalizer for any class
of object that is known to retain mac-pointers in specific slots. Of
course, this assumes that the entire heap is GCed at least
Lawrence G. Mayka
AT&T Bell Laboratories