unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Michael J. Barillier" <blackwolf@blackwolfinfosys.net>
Subject: Re: Memory leak in scm_c_eval_string?
Date: Mon, 19 Dec 2005 11:10:43 -0600	[thread overview]
Message-ID: <87slspc8rw.fsf@shadizar.blackwolfinfosys.net> (raw)
In-Reply-To: <871x0cr5u6.fsf@zip.com.au> (Kevin Ryde's message of "Sat, 17 Dec 2005 10:16:01 +1100")

>>>>> "kr" == Kevin Ryde <user42@zip.com.au> 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


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


      reply	other threads:[~2005-12-19 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-16 15:45 Memory leak in scm_c_eval_string? Michael J. Barillier
2005-12-16 23:16 ` Kevin Ryde
2005-12-19 17:10   ` Michael J. Barillier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87slspc8rw.fsf@shadizar.blackwolfinfosys.net \
    --to=blackwolf@blackwolfinfosys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).