TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Roger Scudder
from: Bo Simonsen
date: 2003-10-18 14:10:28
subject: Memory matters

RS> On: 17 Oct 03  12:58:32 Bo Simonsen wrote to Pascal Schmidt:

 > Unfortionally I'm talking of a huge structure which look like this,
 >    ----- cfg.h begins -----

 RS>  That is moderate in size compared to some of the 
 RS> programs I have worked on... it's definitely not huge, 
 RS> IMO.  If you structure your program well it should be 
 RS> possible to deallocate these pointers in a very elegant 
 RS> way.  Obviously that doesn't mean lining them all up 
 RS> and freeing one after the other at the end of main.  
 RS> Every program has a natural flow of creation and 
 RS> destruction.  It's up to the programmer to handle that flow tastefully. 

Okay, so you mean I should free it along with the programming is getting to
it's end? 

The problem is that I'm using it all over the program, from start to end..

 > I could limit some of chars hardcoding a value.. But 
 > anyway it would be waste of memory..

 RS>  I disagree.  If you follow the fidonet technical 
 RS> specification the wasted memory would be very minimal.  

Yes that's right. Fx. Desc can maximal be 80 charecters, but the
problem is that some problems doesn't do checking about that,
so I anyway is getting a describtion which is over 80 charecters.

 RS> Those bytes would have been important in the days of 
 RS> 640k DOS memory.  On a modern Linux or Windows system 
 RS> the little bit of unused padding is inconsequential.

That's right..

Regards,
Bo


--- Maximus/UNIX 3.03b
* Origin: The Night Express (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™.