TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Bo Simonsen
from: Ali Cinar
date: 2003-10-17 09:51:44
subject: Memory matters

Hello Bo.

15 Oct 03 06:28, Jasen Betts wrote to you:

 JB> it's a good idea to free it at the end of the program, but most
 JB> platforms will free it for you if you leave it allocated.

 JB> one handy way to free global allocations is to put all the frees in an
 JB> exitfunction and use atexit() to register it.

If you are using GNU's C compiler, it comes with a function
named alloca() (declared in alloca.h) . When you use alloca()
instead of malloc() in a function, then the compiler automaticaly
free the memory for you when the function exits/returns.
It is very useful when dealing with big functions.

Best regards, Ali


--- GoldED+/LNX 1.1.4.7
* Origin: www.zdo.com (2:250/607.14)
SEEN-BY: 633/267 270
@PATH: 250/607 501 140/1 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.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™.