Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] what magic is this?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-08-04 (07:27)
From: effbiae@i...
Subject: [Caml-list] what magic is this?
i've started writing a mmap module.  i'm looking at the source to bigarray
to see how it's done. in, 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/   primitives_table ... "%bigarray_ref_1" ...


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"

any pointers greatly appreciated.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: