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] GC, Anonymous Functions, and C
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-12-17 (23:09)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] GC, Anonymous Functions, and C
On 17 déc. 2004, at 22:55, Jonathan Roewen wrote:

> Basically, we're trying to do interrupt handling from OCaml, and need
> to store the anonymous functions somewhere for the IDT to jump into,
> to provide a little context for the problem.

This is going to be extremely tricky, if it ever works, because
OCaml code can allocate memory by calling malloc.  And malloc
is not reentrant, so calling it from a signal handler cannot be
correct unless your main program never calls malloc, which rules
out a large number of functions of the C stdlib.  And you don't
even know which ones exactly...

-- Damien