Mail Archives: djgpp/1996/11/28/20:20:10
Leath Muller wrote:
>
> Actually, if I have a subroutine, which contains a _lot_ of local variables,
> does malloc _really_ get called all the time? I profiled my texture mapping
> code, and found that the malloc() routine was taking up about 17% of the
> program execution time.
>
> Does this sound right? If it is, I think I will be moving to a lot of
> globals instead...
Nope. Local variables are always allocated off of the stack. There is
no way that your program can call malloc() unless you use code which
explicitly requests it. (aside from the startup code, of course,
although I think that uses sbrk() not malloc()...)
--
John M. Aldrich, aka Fighteer I <fighteer AT cs DOT com>
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:- a-->? c++>$ U@>++$ p>+ L>++ E>+ W++ N++ o+ K? w(---) O-
M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+ tv+() b+++ DI++ D++ G e(*)>++++
h!() !r !y+()
------END GEEK CODE BLOCK------
- Raw text -