From ... Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeeds.belnet.be!news.belnet.be!news.tele.dk!129.240.148.23!uio.no!Norway.EU.net!127.0.0.1!nobody From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: Allocating on the stack and *only* on the stack Date: 11 Dec 2000 18:45:45 +0000 Organization: Naggum Software; vox: +47 800 35477; gsm: +47 93 256 360; fax: +47 93 270 868; http://naggum.no; http://naggum.net Lines: 32 Message-ID: <3185549145249958@naggum.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: oslo-nntp.eunet.no 976562222 16220 195.0.192.66 (11 Dec 2000 19:17:02 GMT) X-Complaints-To: newsmaster@eunet.no NNTP-Posting-Date: 11 Dec 2000 19:17:02 GMT mail-copies-to: never User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 Xref: supernews.google.com comp.lang.lisp:5028 * Fernando Rodríguez | How can I make *absolutelly* sure that lisp allocates memory on the | stack? By calling a stack-allocating function yourself, presumably, but this is such an odd request that I doubt that you have asked for what you really need. | It's a class that uses some windows resources that *must* be freed | when leaving the function body where the class is used. What does "free" mean? Objects on the stack are not _freed_ at all. The bytes of memory that made them up are still there until they are overwritten with something else. If you have any references to that data when you leave the function, you're in _deep_ trouble. So what I think you must mean is that you want to guarantee that there are no references to your data. I can't see why that is a problem that does not have an obvious solution: Just the variables/slots/whatever that holds any such references to some other value, or nil, or whatever, and you no longer have any way of finding the data. | In general, how can you free memory "manually", when you can't wait | for the gc? Well, describe what it means to free it, and I'm sure it can be done. #:Erik -- "When you are having a bad day and it seems like everybody is trying to piss you off, remember that it takes 42 muscles to produce a frown, but only 4 muscles to work the trigger of a good sniper rifle." -- Unknown