HasFreeMemory |
|
|
SuggestionsForDiscarding |
|
BytesNeededToRecoverFromLowMemory DisplayedTotalFreeBytes LowOnMemory OutOfMemory PercentUsed TotalFreeBytes TotalFreeKBytes TotalSize |
Define Class HasFreeMemory; mixes in with Object; attribute TotalFreeBytes: Unsigned, readOnly, noGetter; attribute TotalSize: Unsigned, readOnly, noGetter; attribute DisplayedTotalFreeBytes: Unsigned, readOnly, noGetter; // returns TotalFreeBytes, except if low or out of memory, in which case returns zero attribute TotalFreeKBytes: Unsigned, readOnly, noGetter; // returns DisplayedTotalFreeBytes / 1024 attribute PercentUsed: Fixed, readOnly, noGetter; // returns DisplayedTotalFreeBytes as % of TotalSize attribute BytesNeededToRecoverFromLowMemory: Unsigned, readOnly, noGetter; // used by the low on memory display, while the DisplayedTotalFreeBytes is pinned to // zero to show how much more the user needs to throw away to recover from low on memory // add heap statistics interface here attribute LowOnMemory: Boolean, noGetter, noSetter; // in low memory state, trying to recover // inheritor provides boolean field, setter and getter attribute OutOfMemory: Boolean, noGetter, noSetter; // in out of memory state, trying to recover // inheritor provides boolean field, setter and getter operation SuggestionsForDiscarding(), noMethod; // enter the purging scene and create suggestions for discarding from objects on // <self>. end class;