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 theTopMemfunction, which exhibits special behavior during the startup process.
FUNCTION TopMem: Ptr;DESCRIPTION
Except during the startup process, theTopMemfunction 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 checkTopMemto find out how much memory is installed in a computer. To obtain this information, you can currently use theGestaltfunction.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
BufPtrat startup time. If you are writing a system extension, you should not lower the value ofBufPtrby more thanMemTop DIV 2 + 1024. If you do lowerBufPtrtoo far, the startup process generates an out-of-memory system error.You should never need to call
TopMemexcept during the startup process.ASSEMBLY-LANGUAGE INFORMATION
TheTopMemfunction returns the value of theMemTopglobal variable.