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=-2.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI autolearn=unavailable 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!tiscali!newsfeed1.ip.tiscali.net!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Duncan Sands Newsgroups: comp.lang.ada Subject: Re: Is the Ada run-time required to detect out-of-memory Date: Wed, 26 May 2004 10:34:19 +0200 Organization: Cuivre, Argent, Or Message-ID: References: <878yfmiuak.fsf@insalien.org> <2023994.aDeWvtcRlF@linux1.krischik.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1085560470 5819 212.85.156.195 (26 May 2004 08:34:30 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 26 May 2004 08:34:30 +0000 (UTC) To: krischik@users.sourceforge.net, comp.lang.ada@ada-france.org Return-Path: User-Agent: KMail/1.5.4 In-Reply-To: <2023994.aDeWvtcRlF@linux1.krischik.com> Content-Disposition: inline X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: controlnews3.google.com comp.lang.ada:845 Date: 2004-05-26T10:34:19+02:00 > Does calloc know when it gets a new page and when is gets recycled page? This is not really a recycled page. In any case, the answer is probably "no". > 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; > } It's more efficient to not have to zero a page unless you write to it - in fact to not really have any physical pages at all until you write to them. Duncan.