ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/13/06:45:25

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Message-ID: <3CB807B3.829AFC09@yahoo.com>
From: CBFalconer <cbfalconer AT yahoo DOT com>
Organization: Ched Research
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: New DJGPP hogs memory (was: I need help)
References: <5 DOT 0 DOT 2 DOT 1 DOT 0 DOT 20020410122845 DOT 00bcbbd8 AT pop DOT mail DOT yahoo DOT com>
<5 DOT 0 DOT 2 DOT 1 DOT 0 DOT 20020410122845 DOT 00bcbbd8 AT pop DOT mail DOT yahoo DOT com> <5 DOT 0 DOT 2 DOT 1 DOT 0 DOT 20020411161942 DOT 00bd1eb0 AT pop DOT mail DOT yahoo DOT com> <2593-Fri12Apr2002115014+0300-eliz AT is DOT elta DOT co DOT il> <3CB6C8FA DOT 45A31BB7 AT yahoo DOT com> <3CB71962 DOT 1D21ED00 AT yahoo DOT com> <E16w6K0-0004aW-00 AT fencepost DOT gnu DOT org> <3CB75923 DOT C43539D5 AT yahoo DOT com> <4098-Sat13Apr2002112609+0300-eliz AT is DOT elta DOT co DOT il>
Lines: 39
Date: Sat, 13 Apr 2002 10:39:27 GMT
NNTP-Posting-Host: 12.90.170.73
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc04-news.ops.worldnet.att.net 1018694367 12.90.170.73 (Sat, 13 Apr 2002 10:39:27 GMT)
NNTP-Posting-Date: Sat, 13 Apr 2002 10:39:27 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> 
> > From: CBFalconer <cbfalconer AT yahoo DOT com>
> > Newsgroups: comp.os.msdos.djgpp
> > Date: Fri, 12 Apr 2002 22:17:04 GMT
> >
> > First, nmalloc seems to have had no faults shown up with this.  It
> > appears to handle this continuous realloc about 2 to 4 times
> > faster, and to use less memory in the aggregate. Note that
> > evilalgo segfaulted with an input parameter of 45000, while
> > nmalloc lets it handle at least 100000 without squealing (with my
> > memory constraints).
> 
> The segfaults are not the important factor here, and might even hide
> the actual performance issue (memory efficiency) from view: the
> program crashes because it doesn't test the pointer returned by
> realloc before dereferencing it.
> 
> It is much better to modify the code slightly to test whether realloc
> returns NULL, and if so, print the iteration count (and/or the amount
> of memory it succeeded to allocate) and exit.  Then you'd have a more
> accurate quantitative measure of the memory overhead enforced by the
> kind of ridiculously bad reallocation code such as the one used by
> this program.

I did that.  I started from someones evil code, just as a test. 
See the version in 

   <http://cbfalconer.home.att.net/download/hashlib.zip>

Compare the times when it doesn't segfault for the previous
article.

-- 
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net)
   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>  USE worldnet address!


- Raw text -


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