English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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