Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Memory leak
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] Memory leak
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:

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

Markus Mottl

Markus Mottl                                   
Austrian Research Institute
for Artificial Intelligence        
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: