reclaiming space

Bob Calbridge bobc at attctc.Dallas.TX.US
Mon Jan 22 17:36:26 AEST 1990


After two weeks of struggling with a problem, I've finally narrowed down the
cause of it.  The main problem was that I seemed to be unable to reclaim 
certain space for the heap.  What I've discovered is that Turbo C uses heap
space when you open a file.  This I can understand.  However, when the file
is closed, the space is not returned to the heap.  For one shot operations
this is fine.  But my program entails the possiblilty of mulitiple passes where
the user changes data in one file and the program outputs modified data to
another.  Each file appears to take up 264 bytes each.  
 
My question.  Does anyone know how to reclaim this space?  It's hard to write
the program with any predictablility as to how much space I can allocate.

I could also use some advice as to allocating a large area of space.  I've
tried to allocate space in the range of 200K.  I've used farmalloc() although
I'm not certain if this is really necessary in a large model.  I get only
about 19K+.  Do I need to coerce the argument to farmalloc()?  

This group has been a great help in the past and I appreciate the help.  I
hope you can help me this one more time.

Thanks,
Bob
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=    More stupid questions available on request from                          =
-     bobc at attctc                     Your humble servant (real humble)       -
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



More information about the Comp.lang.c mailing list