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!news.maxwell.syr.edu!feed.news.tiscali.de!newsfeed01.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 Date: Wed, 26 May 2004 10:16:23 +0200 Organization: AdaCL Message-ID: <2023994.aDeWvtcRlF@linux1.krischik.com> References: <878yfmiuak.fsf@insalien.org> <1258309.UlGiJVGX7P@linux1.krischik.com> 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 1085559453 02 26519 1dwMGdjraHYMTun 040526 08:17:33 X-Complaints-To: usenet-abuse@t-online.de X-ID: bE9q3rZVYet48Wucc9vAF3xxUhSKhcXPq44LB5fHflhTyknmyzEro2 User-Agent: KNode/0.7.7 Xref: controlnews3.google.com comp.lang.ada:844 Date: 2004-05-26T10:16:23+02:00 List-Id: Duncan Sands wrote: >> one could use calloc. calloc zeros memory and therefore touches every >> page. > > Maybe not - perhaps the virtual memory mapping just points those pages at > the zero page (a special physical page filled with zeros), with > copy-on-write so you get assigned a real page only if you write to it > (calloc won't need to write, because it knows the page starts "filled" > with zeros). Does calloc know when it gets a new page and when is gets recycled page? After all the simplest calloc implementation would be: void* calloc(size_t nmemb, size_t size) { auto void* result = malloc (nmemb * size); memset (result, '\0', nmemb * size); return result; } With Regards Martrin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com