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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed.mathworks.com!irazu.switch.ch!switch.ch!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Is the Ada run-time required to detect out-of-memory conditions? Date: Sat, 22 May 2004 16:09:30 +0200 Organization: AdaCL Message-ID: <1851484.7OLjQvVx1o@linux1.krischik.com> References: <878yfmiuak.fsf@insalien.org> <2h7b84Fa2aefU1@uni-berlin.de> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1085237224 01 9871 Yyh5GVn6AyqnRH8 040522 14:47:04 X-Complaints-To: usenet-abuse@t-online.de X-ID: XHva4mZGYeYlGD7CL2TiDT47L3OO4GnhZOu0iTo5SRqCZJ20eE9qgQ User-Agent: KNode/0.7.7 Xref: controlnews3.google.com comp.lang.ada:776 Date: 2004-05-22T16:09:30+02:00 List-Id: Duncan Sands wrote: >> I'm very new to Ada, but I'm impressed of all the features. In parallel >> I'm developing a little library to make C programming easier. In this >> library I malloc'ed some "emergency memory" at the program start which >> is simply freed when the process gets out of memory. Then the error >> handler can at least raise an exception or print some warning. > > This will not work on some operating systems (such as linux). They don't > actually allocate the memory until you access it (in particular this means > that malloc never fails). But malloc () will write its bookkeeping before each allocation. So if you allocate less then a pagesize every page is used at least once. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com