comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: Is the Ada run-time required to detect out-of-memory
Date: Wed, 26 May 2004 18:20:16 +0200
Date: 2004-05-26T18:20:16+02:00	[thread overview]
Message-ID: <1459490.rBJp702xU0@linux1.krischik.com> (raw)
In-Reply-To: mailman.3.1085560469.391.comp.lang.ada@ada-france.org

Duncan Sands wrote:

>> 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".

I was thinking about pages recycled by free (). 

>> 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.

Remember: Not all memory for malloc and calloc come staid from the OS. Some
have been freed by free (); 

With Regards

Martin
-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




  reply	other threads:[~2004-05-26 16:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-20 22:54 Is the Ada run-time required to detect out-of-memory conditions? Ludovic Brenta
2004-05-21  0:44 ` Georg Bauhaus
2004-05-21  0:47 ` Stephen Leake
2004-05-21  0:54   ` Georg Bauhaus
2004-05-21  1:00     ` Stephen Leake
2004-05-21  3:29 ` Robert I. Eachus
2004-05-21  8:04 ` Vinzent 'Gadget' Hoefler
2004-05-21  9:34   ` Martin Krischik
2004-05-21 11:13 ` Wojtek Narczynski
2004-05-21 12:55   ` Martin Krischik
2004-05-21 16:00     ` Robert I. Eachus
2004-05-21 17:13       ` Ludovic Brenta
2004-05-21 23:41         ` Wojtek Narczynski
2004-05-23  8:20       ` Martin Krischik
2004-05-21 19:58   ` Randy Brukardt
2004-05-21 16:56 ` Mark H Johnson
2004-05-21 17:19   ` Ludovic Brenta
2004-05-21 21:39 ` user
2004-05-21 22:04   ` Ludovic Brenta
2004-05-21 22:11     ` Ludovic Brenta
2004-05-22 11:40       ` Simon Wright
2004-05-25 20:43     ` Is the Ada run-time required to detect out-of-memory Robert I. Eachus
2004-05-25 20:58       ` Duncan Sands
2004-05-25 21:19       ` Ludovic Brenta
2004-05-25 21:31         ` Duncan Sands
2004-05-26  7:09       ` Martin Krischik
2004-05-26  7:38         ` Duncan Sands
2004-05-26  8:16           ` Martin Krischik
2004-05-26  8:34             ` Duncan Sands
2004-05-26 16:20               ` Martin Krischik [this message]
2004-05-22 13:40   ` Is the Ada run-time required to detect out-of-memory conditions? Duncan Sands
2004-05-22 14:09     ` Martin Krischik
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox