Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] CamlDL/Abstract pointers problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] CamlDL/Abstract pointers problem
On Thu, Jan 29, 2004 at 08:55:16PM +0100, Alain.Frisch@ens.fr wrote:
> Reference: http://pauillac.inria.fr/~doligez/caml-guts/Fahndrich99.txt

Interesting.  Can someone who knows about the guts of OCaml comment on
this: Does OCaml store simply the start and extent of the "ML Heap"?
Or does it know about individual blocks of ML heap and use some sort
of tree structure to work out if a pointer points into the heap?

I could imagine a scenario like this:

+---------+
| ML      |
| Heap    |
|         |
|    ---------\
|         |   |
+---------+   |
              |
+---------+   |
| C       |<--/
| malloc  |
+---------+

+---------+
| More    |
| ML      |
| Heap    |
|         |
+---------+

If OCaml only knew about the start and extent of the ML heap, then it
might think that the pointer to the C-allocated space lies within the
ML heap.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
C2LIB is a library of basic Perl/STL-like types for C. Vectors, hashes,
trees, string funcs, pool allocator: http://www.annexia.org/freeware/c2lib/

-------------------
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