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
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-08-23 (20:23)
From: Romain Beauxis <toots@r...>
Subject: Re: [Caml-list] caml_copy_string
Le lundi 23 août 2010 07:09:05, Florent Monnier a écrit :
> an alternative method is to provide a string from ocaml to c then c fills
> this  buffer, then you can save allocations by reusing the same buffer,
> see:

This is a good idea but I would be a little bit suspicious about using 
"noalloc". Even if it works in your tests, this options is very delicate to 
use with the Gc, and may segfault in some cases.

Beside, I think that the benefit of noalloc have to be traded off with the 
complexity of the function in terms of elementary instructions.