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] real-time ocaml RE: ocaml, simd, & fftwgel
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-02 (02:56)
From: Gurr, David (MED, self) <David.Gurr@m...>
Subject: [Caml-list] real-time ocaml RE: ocaml, simd, & fftwgel

Travis Bemann:
> Note that there is no such thing as a C allocator in OCaml, even
> though you can have "custom blocks" that have custom C finalization
> code (and which are also not looked inside by OCaml itself).   ...

I chop my code into real and non-real time parts.  The real 
time part does no allocation.  At initialization time
I call a C function that mallocs all the memory the real time
portion will use and returns a slew of pointers.  The pointers
will not be followed by GC since they are outside the heap.  That
is good since the stuff they point to will never contain pointers
to memory allocated at run time and thus no pointers to OCaml 
allocated memory. This is what I would do in any language.  If
you use Camoflage, you can even use OCaml type defs to do the
memory layout.  By doing this, I dont care about the GC or
compaction or finialization or ... . The only time there is a
problem is if ocamlopt heap allocs a float and the work arounds
for that are no worse than writing a small chunk of code in C.
It is less painful than handwritten C.  -D

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: