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
Heaps size problems with "caml_alloc_small" in foreign function interfaces
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-07-11 (15:56)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Heaps size problems with "caml_alloc_small" in foreign function interfaces
On Fri, Jul 11, 2008 at 08:21:45PM +1000, Sean Seefried wrote:
> caml_alloc_small(32,0);
> is what seemed to cause the problem. I'm shying away from posting more  
> code since it is auto-generated from CamlIDL and is very verbose. I  
> didn't write it myself.

You need to post a reproducer.

> >Secondly (and much more likely to be the problem), the caml_alloc*
> >functions allocate uninitialised memory.  If the garbage collector
> What do you mean by "uninitialised memory"?

Memory which hasn't been explicitly initialized, and so contains
random stuff.  The GC attempts to interpret the random stuff and

> What do you do about this? Is there a way to stop the GC from running  
> for a period of time?

The GC could possibly run any time you call an allocation function.
So don't call allocation functions.

Anyhow, you really need to post some code at this point.


Richard Jones
Red Hat