🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.mac
Article #6563

Speeding up memory allocation

#6563
From: Steve Kearns
Date: Fri, 25 Jul 1986 19:17
19 lines
1578 bytes
Here is a tip that speeds up memory allocation by a factor of 5.  
If you use Lightspeed C memory management routines (malloc or mlalloc)
try removing the call to ResrvMem  in the mlalloc routine in the 
<storage> project.  (you must recompile and reload the project to 
activate the change, of course).  I found that calls to malloc 
sped up by a at least a factor of 5, in my program.  
	The only potential problem with this is that memory may tend to get more
gapped.  
	Note that the mac Ptr allocating routine (NewPtr) automatically calls
ResrvMem, so using NewHandle and locking without calling it should be much
faster.  
	ResrvMem tries all possible ways of allocating a memory block low in 
memory.  Its only purpose is to try and allocate memroy as low as possible;
If this memory is to be locked this action supposedly prevents memory from
getting as gapped.  
	(I have an old mac, old roms, etc.. )

-steve
(kearns@columbia-20)
Technical Details
Message-ID: <2807@columbia.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!columbia!garfield.columbia.edu!kearns
References: <567@ptsfb.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!columbia!garfield.columbia.edu!kearns
From: kearns@garfield.columbia.edu (Steve Kearns)
Newsgroups: net.micro.mac
Subject: Speeding up memory allocation
Message-ID: <2807@columbia.UUCP>
Date: Fri, 25-Jul-86 15:17:03 EDT
Article-I.D.: columbia.2807
Posted: Fri Jul 25 15:17:03 1986
Date-Received: Fri, 25-Jul-86 21:54:21 EDT
References: <567@ptsfb.UUCP>
Sender: nobody@columbia.UUCP
Reply-To: kearns@garfield.UUCP (Steve Kearns)
Organization: Columbia University CS Department
Lines: 19
Summary: 5 times speedup on malloc