Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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).

Thanks,
Julien

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