[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to free the memory occupied by the instance object?
- To: comp-lang-lisp-mcl@services.cambridge.apple.com
- Subject: Re: How to free the memory occupied by the instance object?
- From: lgm@polaris.ih.att.com (Lawrence G. Mayka)
- Date: Tue, 26 Jul 1994 12:59:17 GMT
- In-reply-to: lynch@ils.nwu.edu's message of 26 Jul 1994 00:45:53 GMT
- Newsgroups: comp.lang.lisp.mcl
- Organization: AT&T Bell Laboratories, Naperville, Illinois, USA
- References: <30tv4p$dhv@debbie.cc.nctu.edu.tw> <lynch-2507942005550001@129.105.100.156>
- Sender: news@nntpa.cb.att.com (Netnews Administration)
In article <lynch-2507942005550001@129.105.100.156> lynch@ils.nwu.edu (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
occasionally.
--
Lawrence G. Mayka
AT&T Bell Laboratories
lgm@ieain.att.com
Standard disclaimer.