Re: Re: [Lush-users] loosing memory in compiled code
Ralf Juengling <[email protected]> Tue, 21 Feb 2006 14:55:26 -0800 (PST)
| Newsgroups | gmane.lisp.lush.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 21 Feb 2006, Leon Bottou wrote: > On Tuesday 21 February 2006 02:28 pm, Ralf Juengling wrote: >> I don't believe that. ;-) Let's look at some code: >> >> (defclass A Object >> ((-idx2- (-double-)) m) ) >> >> (defmethod A A (n) >> ((-int-) n) >> (setq m (double-matrix n n) )) >> >> [...] >> >> (dhc-make () >> (A A do) >> ) > > I am checking this code, and I cannot see a memory leak. > I found and corrected three little unrelated memory leaks > in the process, saving a total of 400 bytes. No, this code unfortunately does not demonstrate the problem I reported earlier. I just posted it to have something concrete to talk about. >> Looking at the example aboive, is there a difference in "ownership" of >> the instance variable m depending on whether the class constructor >> is compiled or not? How exactly is the memory for m handled in each >> case? > > Object belong to C when they are manually allocated from C code, > for instance using "dynamic.lsh". lisp_c tracks these objects > in order to be able to present their contents to the interpreter (although > their memory allocation is entirely under the control of the C code.) > This is obviously not the case here. > > Nothing "belongs to C" unless someone calls one of > the cside_create_XXX() functions from the compiled code > (typically after malloc() or equivalent). That helps, thanks. Later, Ralf ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642