![]() |
TopMem |
||||
Header: | MacMemory.h | Carbon status: | Supported | |
Returns a pointer to the top of an applications partition.
Ptr TopMem ();
TopMem obtains a pointer to the byte at the top of an applications partition, directly above the jump table. TopMem does this to maintain compatibility with programs that check TopMem to find out how much memory is installed in a computer. The preferred method of obtaining this information is with the Gestalt 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 of BufPtr by more than MemTop DIV 2 + 1024. If you do lower BufPtr too far, the startup process generates an out-of-memory system error.
You should never need to call TopMem except during the startup process.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)