DosMemAvail: Difference between revisions
Appearance
No edit summary |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This call returns the size of the largest block of free memory. | This call returns the size of the largest block of free memory. | ||
Line 9: | Line 5: | ||
==Parameters== | ==Parameters== | ||
;MemAvailSize (PULONG) - output : Address of the size of the largest free block of memory. | ;MemAvailSize (PULONG) - output: Address of the size of the largest free block of memory. | ||
==Return Code== | ==Return Code== | ||
;rc (USHORT) - return:Return code description is: | |||
Return code description is: | *0 NO_ERROR | ||
*0 | |||
==Remarks== | ==Remarks== | ||
DosMemAvail allows an application to determine how heavily used system memory is at a particular time. The returned value is a "snapshot" that may be valid only at the moment this function is issued and can be expected to change at any time due to system activity. | DosMemAvail allows an application to determine how heavily used system memory is at a particular time. The returned value is a "snapshot" that may be valid only at the moment this function is issued and can be expected to change at any time due to system activity. | ||
This call can be used as an indicator for memory availability before a call to DosAllocHuge is made. | This call can be used as an indicator for memory availability before a call to [[DosAllocHuge]] is made. | ||
== | ==Bindings== | ||
===C | ===C=== | ||
<PRE> | <PRE> | ||
#define INCL_DOSMEMMGR | #define INCL_DOSMEMMGR | ||
USHORT rc = DosMemAvail(MemAvailSize); | USHORT rc = DosMemAvail(MemAvailSize); | ||
PULONG MemAvailSize; /* Size available (returned) */ | |||
PULONG | USHORT rc; /* return code */ | ||
USHORT | |||
</PRE> | </PRE> | ||
===MASM | ===MASM=== | ||
<PRE> | <PRE> | ||
EXTRN DosMemAvail:FAR | EXTRN DosMemAvail:FAR | ||
Line 44: | Line 36: | ||
</PRE> | </PRE> | ||
[[Category:Dos16]] | |||
[[Category: |
Latest revision as of 04:47, 26 January 2020
This call returns the size of the largest block of free memory.
Syntax
DosMemAvail (MemAvailSize)
Parameters
- MemAvailSize (PULONG) - output
- Address of the size of the largest free block of memory.
Return Code
- rc (USHORT) - return
- Return code description is:
- 0 NO_ERROR
Remarks
DosMemAvail allows an application to determine how heavily used system memory is at a particular time. The returned value is a "snapshot" that may be valid only at the moment this function is issued and can be expected to change at any time due to system activity.
This call can be used as an indicator for memory availability before a call to DosAllocHuge is made.
Bindings
C
#define INCL_DOSMEMMGR USHORT rc = DosMemAvail(MemAvailSize); PULONG MemAvailSize; /* Size available (returned) */ USHORT rc; /* return code */
MASM
EXTRN DosMemAvail:FAR INCL_DOSMEMMGR EQU 1 PUSH@ DWORD MemAvailSize ;Size available (returned) CALL DosMemAvail Returns WORD