comp.lang.ada
 help / color / mirror / Atom feed
* [Q]: arrays into mmap'ed memory
@ 1996-08-28  0:00 Jonas Nygren
  1996-08-28  0:00 ` David C. Hoos, Sr.
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jonas Nygren @ 1996-08-28  0:00 UTC (permalink / 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




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

end of thread, other threads:[~1996-09-06  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-28  0:00 [Q]: arrays into mmap'ed memory Jonas Nygren
1996-08-28  0:00 ` 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

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