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
mmap() and strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-12-08 (20:50)
From: Julien Cristau <julien.cristau@e...>
Subject: Re: [Caml-list] mmap() and strings
I wrote:
> > We thought we could use mmap(2), 
> > but there seems to be no easy solution 
> > to mmap() a memory region and treat it as a string in ocaml. 
On 08/12/2004-21:18, Basile STARYNKEVITCH wrote:
> Use Bigarray-s for that. They can mmap files (on Unix & Linux) and are
> already in Ocaml 3.08
Actually, i had a look at bigarrays, and it's one of the solutions I 
considered. However, I'd like to keep strings as data structure, because 
the operations I have to perform take a string as an argument, and not a 
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t, 
and it would be a pain to change all these functions (if I change them, 
I'll probably bind mmap() and munmap() directly and call them with 
MAP_ANONYMOUS, but I'd rather not do that).


[please don't Cc: me on replies, I'm subscribed]