[comp.sys.mac.programmer] PurgeSpace Problem

delft@fwi.uva.nl (Andre van Delft) (01/14/90)

I am trying to get a modified version of TESample.c (MPW 3.0)
to work, but I have problems with the memory manager.

The following are my changes to TESample:

* Removed everything that had to do with segmentation
* Changed some values in TESample.h:
   #define kPrefSize   244             (was:  122)
   #define kMinSize    160             (was:   38)
   #define kMinHeap    (59 * 1024)     (was:  (29 * 1024))
   #define kMinSpace   (40 * 1024)     (was:  (20 * 1024))
* Linked with two additional libraries of 20 and 56 k.

The initialisation code of TESample contains:
 
PurgeSpace(&total,&contig); if(total<kMinSpace) BigBadError(eNoMemory);

Here BigBadError is called, because total is about 5000.
Strangely enough, the  About the Finder  dialog shows that TESample
uses less than 40% of its 244 k total space.

How can I circumvent this problem? Should I not have left out the
segmentation statements? Should I have specified different #define
values?

Andre van Delft.