From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 86BCDBB81 for ; Wed, 8 Dec 2004 21:50:47 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iB8Kol8U030935 for ; Wed, 8 Dec 2004 21:50:47 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA24481 for ; Wed, 8 Dec 2004 21:50:46 +0100 (MET) Received: from bernache.ens-lyon.fr (bernache.ens-lyon.fr [140.77.167.10]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iB8Kokqi006115 for ; Wed, 8 Dec 2004 21:50:46 +0100 Received: by bernache.ens-lyon.fr (Postfix, from userid 103) id 02F197ABD45; Wed, 8 Dec 2004 21:50:45 +0100 (CET) Received: from bryan.is-a-geek.org (unknown [84.97.241.83]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by bernache.ens-lyon.fr (Postfix) with ESMTP id 65E227ABD44 for ; Wed, 8 Dec 2004 21:50:44 +0100 (CET) Received: by bryan.is-a-geek.org (Postfix, from userid 1000) id F32669339A; Wed, 8 Dec 2004 21:50:42 +0100 (CET) Date: Wed, 8 Dec 2004 21:50:42 +0100 From: Julien Cristau To: caml-list@inria.fr Subject: Re: [Caml-list] mmap() and strings Message-ID: <20041208205042.GD1840@ens-lyon.fr> Mail-Followup-To: caml-list@inria.fr References: <20041208200458.GC1840@ens-lyon.fr> <20041208202428.GA9878@ours.starynkevitch.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041208202428.GA9878@ours.starynkevitch.net> X-Operating-System: Linux 2.6.8.1 i686 Organization: =?iso-8859-1?Q?=C9cole_Normale_Sup=E9rieur?= =?iso-8859-1?Q?e?= de Lyon User-Agent: Mutt/1.5.6+20040722i X-Miltered: at nez-perce with ID 41B76927.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41B76926.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ens-lyon:01 caml-list:01 wrote:01 ocaml:01 basile:01 wrote:01 ocaml:01 bigarrays:01 char:01 bigarray:01 elt:01 bigarray:01 unix:01 strings:01 strings:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: 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]