TIP: Click on subject to list as thread! ANSI
echo: cis.os9.68000.osk
to: Pete Lyall 76703,4230 (X)
from: Bob van der Poel 76510,2203
date: 1991-06-26 21:15:33
subject: #11187-#Allocation help

#: 11202 S12/OS9/68000 (OSK)
    26-Jun-91  21:15:33
Sb: #11187-#Allocation help
Fm: Bob van der Poel 76510,2203
To: Pete Lyall 76703,4230 (X)

Pete/JJ, I think that the 'nicest' way to do the allocation *is* with two
malloc()s. But, even if malloc() doesn't need to call the system at all for
memory it still exacts a fairly heavy price in overhead. Each malloc() has to
keep track of the memory point and the size (I believe it uses a linked list
for this). Something like 8 bytes per call? The other un-nice thing about two
malloc()s is that two free()s are needed to get rid of the stored stuff--again,
not a big deal, but one more thing to go wrong!

BTW, I "discovered" an interesting thing about the the 68K compilier--it does
structure assignments and will pass structures by value (pushes the whole thing
onto the stack!). Don't ask just how I found this out .

There is 1 Reply.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.