delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-workers-bounces using -f |
Date: | Wed, 20 Feb 2002 19:42:02 +0200 |
From: | "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> |
Sender: | halo1 AT zahav DOT net DOT il |
To: | Eric Rudd <rudd AT cyberoptics DOT com> |
Message-Id: | <2110-Wed20Feb2002194202+0200-eliz@is.elta.co.il> |
X-Mailer: | emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9 |
CC: | djgpp-workers AT delorie DOT com |
In-reply-to: | <3C73BBE2.9289C4F6@cyberoptics.com> (message from Eric Rudd on |
Wed, 20 Feb 2002 09:08:19 -0600) | |
Subject: | Re: Malloc/free DJGPP code |
References: | <10202200445 DOT AA15769 AT clio DOT rice DOT edu> <3C734B2D DOT F82A42FB AT yahoo DOT com> <3C73BBE2 DOT 9289C4F6 AT cyberoptics DOT com> |
Reply-To: | djgpp-workers AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | djgpp-workers AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
> Date: Wed, 20 Feb 2002 09:08:19 -0600 > From: Eric Rudd <rudd AT cyberoptics DOT com> > > for (n=1; ; n++) { > data = realloc(data, n*sizeof(*data)); > if (fscanf(infile, "%d", &data[n-1]) != 1) break; > } > > (If blocks are allocated in sizes that are powers of two, there's no reason > this last example can't be made to run fast -- though it's presently slow, Is that with the CVS version or with the one in djdev203? I believe Mark made a change in CVS that speeds up realloc by a large factor. > By these examples, I wish to encourage people to think broadly about the > malloc optimization question. In particular, I think we can expect some > objections if any aspect of performance is significantly worsened, even > though a new malloc performs better in some other respect. I can only repeat that DJ's malloc test programs from the time v2.0 was developed are still available, and it's probably a good idea to run them in case of any significant changes in malloc. IIRC, those programs did try to simulate different types of allocation requests.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |