Hi All,
I'm new to mac programming, and using MPW to develop a simple application. Could someone with a better grasp of Mac System 7 (v7.5.5) development let me know where i'm going wrong?
Allocating a large rectangle with NewGWorld fails due to an OOM error (-108). I was able to solve this by using "get info" and increasing the reserve memory above the 512k the application is automatically allocated. I wish to be able to do that programmatically, however I am unable to actually grow the heap size using:
SetApplLimit((Ptr) GetApplLimit - 10000L);
OSErr memErr = MemError();
After running the above snippet memErr consistently contains -108, the same out of memory error (This happens no matter what size I attempt to grow the heap by).
To answer the obvious question, yes I have lots of free memory available on the system, the largest unused block is over 20MB.
As far as I can tell from looking at https://www.vintageapple.org/inside_r/pdf/Memory_1992.pdf, this function should reserve more memory for my application.
Thanks!
I'm new to mac programming, and using MPW to develop a simple application. Could someone with a better grasp of Mac System 7 (v7.5.5) development let me know where i'm going wrong?
Allocating a large rectangle with NewGWorld fails due to an OOM error (-108). I was able to solve this by using "get info" and increasing the reserve memory above the 512k the application is automatically allocated. I wish to be able to do that programmatically, however I am unable to actually grow the heap size using:
SetApplLimit((Ptr) GetApplLimit - 10000L);
OSErr memErr = MemError();
After running the above snippet memErr consistently contains -108, the same out of memory error (This happens no matter what size I attempt to grow the heap by).
To answer the obvious question, yes I have lots of free memory available on the system, the largest unused block is over 20MB.
As far as I can tell from looking at https://www.vintageapple.org/inside_r/pdf/Memory_1992.pdf, this function should reserve more memory for my application.
Thanks!

