in reply to Re: Design Question
in thread Design Question

Hi, thanks for your help!

Knowing when to call clear_big_array is harder.


So if I take this approach, I will need to have a "convention" that all sub-routines in this package call clear_big_array when they are done with this array, or before they start using it. I can see that being a bit harder to maintain -- are there any other disadvantages to that?

Replies are listed 'Best First'.
Re: Re: Re: Design Question
by sgifford (Prior) on Aug 07, 2003 at 03:09 UTC

    I can't think of any other disadvantages. Even if you never call clear_big_array, it might not matter, the memory will just stay allocated. Generally the program won't return memory to the OS until it exits, and if the OS needs the memory for something else it will just page it out.

    If you give more details about exactly what you're doing, you might be able to get more specific advice.