<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Amalloc-test.c</id>
	<title>SE250:malloc-test.c - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Amalloc-test.c"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:malloc-test.c&amp;action=history"/>
	<updated>2026-04-24T11:36:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=SE250:malloc-test.c&amp;diff=9208&amp;oldid=prev</id>
		<title>Mark: 1 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:malloc-test.c&amp;diff=9208&amp;oldid=prev"/>
		<updated>2008-11-03T05:20:49Z</updated>

		<summary type="html">&lt;p&gt;1 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; /*&lt;br /&gt;
   File:   malloc-test.c&lt;br /&gt;
   Author: John Hamer&lt;br /&gt;
   Date:   27 March 2008&lt;br /&gt;
   Purpose: Look at malloc overhead&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main( ) {&lt;br /&gt;
   int block = 1000;&lt;br /&gt;
   long malloc_count = 0;&lt;br /&gt;
   while( malloc(block) != 0 )&lt;br /&gt;
     malloc_count++;&lt;br /&gt;
 &lt;br /&gt;
   printf( &amp;quot;Able to allocate %ld %d-byte blocks for a total of %ld bytes of useful memory\n&amp;quot;,&lt;br /&gt;
           malloc_count, block, malloc_count * block );&lt;br /&gt;
   return 0;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /*&lt;br /&gt;
 Dell Latitude D810:&lt;br /&gt;
   Able to allocate 52006855 1-byte blocks    (total:   52,006,855 bytes of useful memory)&lt;br /&gt;
   Able to allocate 825392 1,000-byte blocks  (total:  825,392,000 bytes of useful memory)&lt;br /&gt;
   Able to allocate 79551 10,000-byte blocks  (total:  795,510,000 bytes of useful memory)&lt;br /&gt;
 &lt;br /&gt;
 wintermute01:&lt;br /&gt;
   Able to allocate 268016277 1-byte blocks  (total:    268,016,277 bytes of useful memory)&lt;br /&gt;
   Able to allocate 4254317 1000-byte blocks (total:  4,254,317,000 bytes of useful memory)&lt;br /&gt;
   Able to allocate 428531 10000-byte blocks (total:  4,285,310,000 bytes of useful memory)&lt;br /&gt;
 */&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>