comp.lang.ada
 help / color / mirror / Atom feed
From: Jonas Nygren <jonas@joy.ericsson.se>
Subject: [Q]: arrays into mmap'ed memory
Date: 1996/08/28
Date: 1996-08-28T00:00:00+00:00	[thread overview]
Message-ID: <32249A94.4A0A@joy.ericsson.se> (raw)


Can anybody help me with how to use mmap'ed memory in Ada. What I want
to do is mmap a large file and then access parts of the so mapped 
memory via arrays.

In C it is simple since arrays are more or less a language syntax
on top of pointers, p[i] == *(p+i). How can I connect an Ada array
to memory allocated via mmap? I do not want to store the bounds
of the array in the mapped file - the file should just be plain
ASCII. If I manage to get the array to point to the memory and
the bounds to be set correctly what will happen when Ada tries to
reclaim the array? 

Of course I could use a pointer and write my own access functions
for this pointer but I think that it would be nicer to use arrays
if possible.

This probably sounds confused and reflects my understanding of Ada
but perhaps you get the gist of my question and so can put me straight.

TIA,

/jonas

PS mmap is a unix syscall which maps a file directly into memory
   without the need to allocate memory in your program - you sort of
   get access directly to the OS's file buffers which are loaded
   on access of the memory via direct page-in. DS




             reply	other threads:[~1996-08-28  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-28  0:00 Jonas Nygren [this message]
1996-08-28  0:00 ` arrays into mmap'ed memory David C. Hoos, Sr.
1996-08-29  0:00 ` [Q]: " Jon S Anthony
1996-08-30  0:00 ` Norman H. Cohen
1996-08-31  0:00   ` Geert Bosch
1996-08-31  0:00 ` Laurent Guerby
1996-09-06  0:00   ` Norman H. Cohen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox