www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/25/15:57:07

Message-Id: <m0zMdyd-000S4fC@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
Organization: INTI
To: "Renato F. Cantao" <cantao AT ime DOT unicamp DOT br>, djgpp AT delorie DOT com
Date: Fri, 25 Sep 1998 17:00:20 +0000
MIME-Version: 1.0
Subject: Re: Memory allocation!
References: <m0zMdiG-000S4AC AT inti DOT gov DOT ar>
In-reply-to: <Pine.SUN.3.96.980925165045.24651A-100000@athenas.ime.unicamp.br>

Hi Renato:

> On Fri, 25 Sep 1998, Salvador Eduardo Tropea (SET) wrote:
> 
> > "Renato F. Cantao" <cantao AT ime DOT unicamp DOT br> asked:
> > 
> > > 	I'm working on some mathematics implementations involving large
> > > amounts of memory allocation. So my questions are:
> > > 
> > > 	1. Operator "new" and "malloc" are speed-equivalent?
> > 
> > Almost, new is a wrapper, so it makes some extra checks.
> > 
> > > 	2. Despite the answer, does exist a better (=faster!) way to
> > > allocate memory?
> > 
> > Yes: do your own custom routine optimized for your allocation scheme! ;-)
> > 
> 
> OK, that's perfect. I'm meaning, does exist any other routine faster than
> new or malloc?

Nope. To get the maximum performance you must study your case and see how can 
you reduce the number of calls to new/malloc. In general you can allocate a 
big pool and administrate it in some way that benefits your code.
Quake (programmed with djgpp) uses your own allocator for better debugging 
and less fragmentation, not speed because the djgpp malloc is very fast 
compared with malloc routines like the one in Borland C 3.1.

SET 
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


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