size = AvailMem(attributes)
D0 D1
ULONG AvailMem(ULONG);
This function returns the amount of free memory given certain attributes.
To find out what the largest block of a particular type is, add MEMF_LARGEST into the requirements argument. Returning the largest block is a slow operation.
Due to the effect of multitasking, the value returned may not actually be the amount of free memory available at that instant.
Memory allocation and deallocation as well as querying how much memory is available requires a Task or, by extension, a Process. None of the exec kernel memory management operations is safe to call from interrupt code!
For V36 Exec, AvailMem(MEMF_LARGEST) does a consistency check on the memory list.
Alert AN_MemoryInsane will be pulled if any mismatch is noted.
AvailMem(MEMF_CHIP|MEMF_LARGEST);
/* return size of largest available chip memory chunk */