Important: The information in this document is obsolete and should not be used for new development.
TopMem
To find out the location of the top of an application's partition, you can use theTopMem
function, which exhibits special behavior during the startup process.
FUNCTION TopMem: Ptr;DESCRIPTION
Except during the startup process, theTopMem
function returns a pointer to the byte at the top of an application's partition, directly above the jump table. The function does this to maintain compatibility with programs that checkTopMem
to find out how much memory is installed in a computer. To obtain this information, you can currently use theGestalt
function.The function exhibits special behavior at startup time, and the value it returns controls the amount by which an extension can lower the value of the global variable
BufPtr
at startup time. If you are writing a system extension, you should not lower the value ofBufPtr
by more thanMemTop DIV 2 + 1024
. If you do lowerBufPtr
too far, the startup process generates an out-of-memory system error.You should never need to call
TopMem
except during the startup process.ASSEMBLY-LANGUAGE INFORMATION
TheTopMem
function returns the value of theMemTop
global variable.