www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/11/20:43:11

From: j DOT aldrich6 AT genie DOT com
Message-Id: <199604120022.AA280998576@relay1.geis.com>
Date: Fri, 12 Apr 96 00:01:00 UTC 0000
To: djgpp AT delorie DOT com
Mime-Version: 1.0
Subject: Re: malloc crash

Reply to message 7605615    from ELIZ AT IS DOT ELTA. on 04/11/96  2:41AM


>What matters is not the total size of the allocated memory, but the number
>of independent allocations which live at any given moment.  I doubt that
>any reasonable program has more than a hundred malloced regions
>simultaneously.  The GNU C++ compiler that is the first DJGPP program to
>be known to hit that CWSDPMI limit (see the FAQ), reaches slightly more
>than 200 chunks when compiling some *really* large C++ programs.

I took a closer look at the code for the program as I was writing this
reply, and it turns out that I was slightly wrong.  It does create several
tens of thousands of individual "objects", but it actually grabs the
memory one large block at a time and parcels it out in chunks, just
like you said.  No wonder the damn thing runs so fast... :)  Out of
curiosity, maybe I'll do some internal analysis to see exactly how many
times it actually calls calloc().

Thanks for the insights!

John

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019