From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,195cfda04e416f67 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-05 06:16:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!skynet.be!skynet.be!louie!tlk!not-for-mail Sender: lbrenta@lbrenta Newsgroups: comp.lang.ada Subject: Re: GNAT and Memory Maps? References: From: Ludovic Brenta Date: 05 Jul 2003 15:10:36 +0200 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 80.200.138.19 X-Trace: 1057410963 reader1.news.skynet.be 296 80.200.138.19:52383 X-Complaints-To: usenet-abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:40077 Date: 2003-07-05T15:10:36+02:00 List-Id: Freejack writes: > I've been picking through the GNAT docs (and Ada docs in general) in an > attempt to figure out how/if and when/why the Ada compiler might choose to > use an mmap system call in deference to a malloc/calloc or alloca call. > > Basically, I'm doing some low level routines and I need explicit control > over what pages are swapped and when. ( mmap() mlock() munlock() and > munmap() are the usual C functions for handling this.) > > I'm using Linux at the moment, and I could just as easily use the native C > library (glibc). However, I want to handle this entirely in Ada. I'm using > the No_Run_Time Pragma. > > Note: I'm also a Forther, so the idea of explicit memory and device > handling doesnt frighten me. ;-> > > (Hmmm...now theres an experiment to try sometime. A Subroutine Threaded > Forth VM in Ada.) My first idea is to use your own storage pool; see ARM 13.11 for information on storage pools. However, I'm not sure this approach works with pagma No_Run_Time. By the way, I came across a post by Robert Dewar where he said No_Run_Time is obsolete. Here is the URL: http://gcc.gnu.org/ml/gcc/2002-11/msg00321.html What is your situation? Are you writing a Linux kernel module in Ada? (that's the only reason I can think of to use No_Run_Time) In this case, I'm not sure you can use glibc either. -- Ludovic Brenta.