coreleft
raw OCR
Returns a measure of unused RAM memory.
Defined in header <alloc.h>
Syntax
In the tiny, small,and medium models:
#include <alloc.h>
unsigned coreleft(void);
In the compact, large, and huge models:
#include <alloc.h>
unsigned long coreleft(void);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ |
Remarks
coreleft returns a measure of RAM memory not in use. It gives a different measurement value, depending on whether the memory model is of the small data group or the large data group.
Return value
In the small data models, coreleft returns the amount of unused memory between the top of the heap and the stack. In the large data models, coreleft returns the amount of memory between the highest allocated block and the end of available memory.
See also
Example
#include <stdio.h>
iinclude <alloc.h>
int main(void)
printfC'The difference between the highest allocated block and\n");
printfC'the top of the heap is: %lu bytes\n", (unsigned long) corelefti
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/alloc.h/coreleft/
· short form /3.1/coreleft/