TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Jasen Betts
from: Bo Simonsen
date: 2003-10-16 15:47:28
subject: Memory matters

Hello Jasen!

Oct 15 06:28 03, Jasen Betts wrote to Bo Simonsen:

 BS>> In my file ticker, I'm reading the configuration into a
 BS>> structure.. This structure do I need all the time, so I figured is
 BS>> it nessersary to free it then I'm ending the program

 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.

Indeed, just a big work to free a structure with mutch allocated memory, is
there a easy way for free'ing such a thing?

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

atexit is like a class destructer?

 JB> another is not to allocate them but instead have them as ordinary 
 JB> global variables

?

Regards,
Bo

--- Msged/LNX 6.1.2 (Linux/2.4.18-bf2.4 (i586))
* Origin: The Night Express, Roennede Dk (2:236/100)
SEEN-BY: 633/267 270
@PATH: 236/100 237/9 20/11 106/1 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™.