caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <markus@oefai.at>
To: Scott Cyphers <cyphers@sls.lcs.mit.edu>
Cc: Brian Rogoff <bpr@bpr.best.vwh.net>,
	Martin Jambon <m.jambon@ibcp.fr>,
	caml-list@inria.fr
Subject: Re: [Caml-list] Memory leak
Date: Wed, 17 Apr 2002 11:22:52 +0200	[thread overview]
Message-ID: <20020417092252.GA20621@kiefer.ai.univie.ac.at> (raw)
In-Reply-To: <001e01c1e597$e2ca84b0$17011b12@BEARWITHME>

On Tue, 16 Apr 2002, Scott Cyphers wrote:
> > Sure. There was a great demo of this on the translator's list for the
> > O'Reilly book; create a representation of stacks based on arrays with a
> > top of stack index. Popping items off of the stack by moving the TOS
> > pointer around won't free them. Could you be doing something like that?
> 
> In that particular case, the stack implementation is a lot uglier when you
> need to provide the ability to neutralize array elements of arbitrary type
> as you pop the stack.  Sometimes you get lulled into thinking the GC works
> completely invisibly.

In case you ever need such functionality (stacks based on arrays), you
might want to try the library of resizable arrays called RES, which also
handles resizable strings:

  http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html

It plays some naughty low-level tricks to free memory of unreachable
values, which occur when some resizable array shrinks.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-04-17  9:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-15 19:24 Martin Jambon
2002-04-16 13:22 ` Brian Rogoff
2002-04-16 22:41   ` Scott Cyphers
2002-04-17  9:22     ` Markus Mottl [this message]
2002-04-17 14:53       ` Brian Rogoff
2002-04-16 16:52 ` Martin Jambon

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

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

  git send-email \
    --in-reply-to=20020417092252.GA20621@kiefer.ai.univie.ac.at \
    --to=markus@oefai.at \
    --cc=bpr@bpr.best.vwh.net \
    --cc=caml-list@inria.fr \
    --cc=cyphers@sls.lcs.mit.edu \
    --cc=m.jambon@ibcp.fr \
    /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 NNTP newsgroup(s).