Date: Sat, 26 Jul 1997 09:00:27 -0700 (PDT) Message-Id: <199707261600.JAA29579@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: djgpp AT delorie DOT com From: Nate Eldredge Subject: re: mem alloc taking up power of 2 Precedence: bulk Okay, just to further confuse this thread... ;-) >AFAIK, allocated memory always remains purely "virtual" until it is >actually used. I ran this sample program: #include #include #define SIZE 500000 /* or anything */ int main(void) { unsigned long rt = 0; while (malloc(SIZE) != NULL) printf("Have now malloced %lu bytes\n",rt += SIZE); return 0; } By the above principle, it ought to get to a very high number indeed before stopping, since the only memory actually touched is that for malloc's headers. However, what actually occurs is it stops after reaching an number close to the sum of those reported by go32-v2. Is there a logical way to reconcile the statement and the program? Have I completely overlooked something? What really happens with malloc? How many licks does it take to get to the Tootsie Roll center of a Tootsie Pop? :-) Nate Eldredge eldredge AT ap DOT net