From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA28327; Wed, 4 Aug 2004 09:27:38 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 JAA27850 for ; Wed, 4 Aug 2004 09:27:37 +0200 (MET DST) From: effbiae@ivorykite.com Received: from ensim.smartydns22.com (ev1s-67-15-74-65.ev1servers.net [67.15.74.65] (may be forged)) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i747RZRM018832 for ; Wed, 4 Aug 2004 09:27:36 +0200 Received: from www.ivorykite.com (localhost.localdomain [127.0.0.1]) by ensim.smartydns22.com (8.12.10/8.12.10) with SMTP id i747RZSY023884 for ; Wed, 4 Aug 2004 17:27:35 +1000 Received: from 60.246.254.84 (SquirrelMail authenticated user effbiae@ivorykite.com) by www.ivorykite.com with HTTP; Wed, 4 Aug 2004 17:27:35 +1000 (EST) Message-ID: <42110.60.246.254.84.1091604455.squirrel@www.ivorykite.com> Date: Wed, 4 Aug 2004 17:27:35 +1000 (EST) Subject: [Caml-list] what magic is this? To: caml-list@inria.fr User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Miltered: at concorde with ID 41108FE7.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; bytecomp:01 translcore:01 reuse:01 struct:01 struct:01 pointers:01 linked:01 bigarray:01 bigarray:01 typedef:01 primitives:01 int:01 int:01 external:03 external:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk i've started writing a mmap module. i'm looking at the source to bigarray to see how it's done. in bigarray.ml, external functions Array1.{get,set} are linked to "%bigarray_{ref,set}_1" 1) what's the % -- is this what allows the fast access to the base data? 2) bigarray_ref_1 and bigarray_set_1 are not defined anywhere hold on... greps...finds... bytecomp/translcore.ml: primitives_table ... "%bigarray_ref_1" ... aahhh. i bet i could reuse this in my mmap module. the question is how? typedef struct _MM{int fd;void *map;unsigned long size;}*MM; module Mm = struct type ('a,'b)t external create: 'a a -> 'b b -> ('a, 'b) t external get: ('a, 'b) t -> int -> 'a = "%bigarray_ref_1" external set: ('a, 'b) t -> int -> 'a -> unit = "%bigarray_set_1" ...end any pointers greatly appreciated. jack ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners