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,ab4f67f984ef04f9 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!news.cambrium.nl!news.cambrium.nl!newsfeed.wxs.nl!transit.news.xs4all.nl!195.241.76.212.MISMATCH!tiscali!transit1.news.tiscali.nl!dreader2.news.tiscali.nl!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Is the Ada run-time required to detect out-of-memory conditions? References: <878yfmiuak.fsf@insalien.org> <2h7b84Fa2aefU1@uni-berlin.de> <87n041l9mv.fsf@insalien.org> From: Ludovic Brenta Date: Sat, 22 May 2004 00:11:02 +0200 Message-ID: <87isepl9c9.fsf@insalien.org> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:qPG4IpR3KsvxIoR7kHRYnWAGOT0= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tiscali bv NNTP-Posting-Date: 22 May 2004 00:09:56 CEST NNTP-Posting-Host: 83.134.238.201 X-Trace: 1085177396 dreader2.news.tiscali.nl 41754 83.134.238.201:34822 X-Complaints-To: abuse@tiscali.nl Xref: controlnews3.google.com comp.lang.ada:760 Date: 2004-05-22T00:09:56+02:00 List-Id: Ludovic Brenta writes: > I am quite confident that you can implement your "emergency memory" > scheme in Ada, but this will not do anything to prevent SIGKILL. At > best, you can recover from a SIGSEGV. This is true also of your C > library. I forgot to point you at one of Ada's neat features called "User-Defined Storage Pools". Look at the Ada Reference Manual[1] section 13.11. You can define your own allocation and deallocation mechanism for any access type; your storage pool may for example preallocate X megabytes from the operating system, allocate from that buffer, and raise Storage_Error when it is exhausted. As long as X <= Physical_Ram, you then have a guarantee that your porgram receives Storage_Error and not SIGKILL. [1] http://www.adaic.org/standards/95lrm/html/RM-TTL.html -- Ludovic Brenta.