App memory requirements

Setting your applications memory requirements has to be done via Resource files.

First create a Resource file for your application if you haven’t already. The convention seems to be that your applications main .c file should have a corresponding .r Resource.

For example:

coolapp.c
coolapp.r
coolapp.h

Include the following in your Resource file to define the SIZE of your application. This tells MultiFinder about how large the memory partition should be as well as other various flags which describe how your application operates:

#define MEM_PREF_SIZE_K 2048
#define MEM_MIN_SIZE_K 1028

resource 'SIZE' (-1) {
	dontSaveScreen,
	acceptSuspendResumeEvents,
	enableOptionSwitch,
	canBackground,
	multiFinderAware,
	backgroundAndForeground,
	dontGetFrontClicks,
	ignoreChildDiedEvents,
	not32BitCompatible,
	reserved,
	reserved,
	reserved,
	reserved,
	reserved,
	reserved,
	reserved,
	MEM_PREF_SIZE_K * 1024,
	MEM_MIN_SIZE_K * 1024
};

This will set the minimum ram limit to 1024KB, and the preferred maximum to 2048KB. These should be set to values appropriate for your application.

The flags used here should be suitable for most typical desktop applications but may need some tweaks for things like realtime games.

If you created a new Resource file in order to add the SIZE entry, you will need to re-create your Makefile (Build -> Create Build Commands).

Ensure the Resource file is included in the source file list.