caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Bigarray.*.map_file
@ 2005-09-14 13:43 Bauer, Christoph
  2005-09-14 14:07 ` [Caml-list] Bigarray.*.map_file Olivier Andrieu
  0 siblings, 1 reply; 2+ messages in thread
From: Bauer, Christoph @ 2005-09-14 13:43 UTC (permalink / raw)
  To: caml-list

Hi,

Bigarray.Genarray.map_file uses mmap to "read" a file. How can
I specify an offset in the file (like the offset parameter in mmap)?
Unix.lseek doesn't help me.

How can I do an munmap? I ask because of these lines from the man-page:

       The munmap system call deletes the mappings for the speci-
       fied address  range,  and  causes  further  references  to
       addresses within the range to generate invalid memory ref-
       erences.  The region is also automatically  unmapped  when
       the process is terminated.  On the other hand, closing the
       file descriptor does not unmap the region.

Thanks,

Christoph Bauer
Dipl. Inf.

LMS Deutschland GmbH
Luxemburgerstr. 7
D-67657 Kaiserslautern

T +49 631 303 22 152

mailto:Christoph.Bauer@lms-gmbh.de
http://www.lmsintl.com 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] Bigarray.*.map_file
  2005-09-14 13:43 Bigarray.*.map_file Bauer, Christoph
@ 2005-09-14 14:07 ` Olivier Andrieu
  0 siblings, 0 replies; 2+ messages in thread
From: Olivier Andrieu @ 2005-09-14 14:07 UTC (permalink / raw)
  To: Bauer, Christoph; +Cc: caml-list

Hi,

 Bauer, Christoph [Wednesday 14 September 2005] :
 > Bigarray.Genarray.map_file uses mmap to "read" a file. How can
 > I specify an offset in the file (like the offset parameter in mmap)?
 > Unix.lseek doesn't help me.

You can't: mmap is called with offset 0 (see
otherlibs/bigarray/mmap_unix.c). 

 > How can I do an munmap? I ask because of these lines from the man-page:
 > 
 >        The munmap system call deletes the mappings for the speci-
 >        fied address  range,  and  causes  further  references  to
 >        addresses within the range to generate invalid memory ref-
 >        erences.  The region is also automatically  unmapped  when
 >        the process is terminated.  On the other hand, closing the
 >        file descriptor does not unmap the region.

unmap() is called when the bigarray is collected by the GC.

-- 
   Olivier


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-14 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-14 13:43 Bigarray.*.map_file Bauer, Christoph
2005-09-14 14:07 ` [Caml-list] Bigarray.*.map_file Olivier Andrieu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).