DOS Fn 5801H: Set Memory Allocation Strategy
Compatibility: 3.0+
Expects: AX 5801H
BX desired allocation strategy code (see below).
──────────────────────────────────────────────────────────────────
Returns: AX error code if CF is set to CY
──────────────────────────────────────────────────────────────────
Info: Selects the method for DOS to use in satisfying subsequent memory
allocations (via fn 48H). BX must be one of:
Value Description
▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
0000h FIRST_FIT_LOW Search conventional▲ memory for the available
block having the lowest address. This is the
default strategy.
0001h BEST_FIT_LOW Search conventional RAM for the available block
that most closely matches the requested size.
0002h LAST_FIT_LOW Search conventional RAM for the available block
having the highest address.
─────────────────────────────────────── DOS 5.0+
0080h FIRST_FIT_HIGH Search UMB▲ memory for the available block that
most closely matches the requested size. If
none, search conventional memory.
0081h BEST_FIT_HIGH Search UMB memory for the available block that
most closely matches the requested size. If
none, search conventional memory.
0082h LAST_FIT_HIGH Search UMB memory for the available block having
the highest address. If none, search
conventional memory.
0040h FIRST_FIT_HIGHONLY Search UMB memory for the available block having
the lowest address.
0041h BEST_FIT_HIGHONLY Search UMB memory for the available block that
most closely matches the requested size.
0042h LAST_FIT_HIGHONLY Search UMB memory for the available block having
the highest address.
Versions: ■ Unavailable before DOS 3.0. In 3.x-4.x, only valid codes are
0000h, 0001h, and 0002H. Other code valid only with DOS 5.0+.
Notes: ■ Programs which change the allocation strategy should use fn
5800H and save the current setting and be sure to change it
back (via this fn) before terminating.
■ If the upper memory link has not been set (see fn 5803H), then
all allocations will be in conventional▲ memory.
■ When a program is loaded high via loadhigh, its code will be in
upper memory, but additional allocations will be made according
to the current allocation strategy (you must set it yourself).
See Also: Accessing Upper Memory
Memory Control Functions
DOS Functions
-♦-