guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory leak in scm_c_eval_string?


From: Michael J. Barillier
Subject: Re: Memory leak in scm_c_eval_string?
Date: Mon, 19 Dec 2005 11:10:43 -0600
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

>>>>> "kr" == Kevin Ryde <address@hidden> writes:

    >>  Am I needlessly worrying about this?

    kr> Yep.  When there are no more pointers to an object, it's reaped.

D'oh - forgive the mental lapse.  GC reaps objects no longer pointed
*to* - I knew that.  The other bit I was missing was that the library
functions returning an SCM return a pointer to a cell (with caveats for
immediates, correct?) - I'd misinterpreted the bits about a cell
consisting of, IIRC, 4 words and assumed that the 4-word block itself
was returned (typedef'ed as an SCM), rather than a pointer to the cell
on the heap.  Since that's the case then only the pointer is overwritten
and the cell containing the pointer to the malloc'ed string is still
sitting in the heap and would be collected properly.

Thanks - now I can sleep at night again. :)

-- 
Michael J. Barillier   ///   http://www.blackwolfinfosys.net/~blackwolf/
.O.  |  ``Experience with many protocols has shown that protocols with
..O  |  few options tend towards ubiquity, whereas protocols with many
OOO  |  options tend towards obscurity.''  -- RFC 2821




reply via email to

[Prev in Thread] Current Thread [Next in Thread]