flag (ULONG) - input
A set of flags describing the allocation attributes and desired access protection for the private memory object. Possible values are shown in the lists below:
Allocation Attributes
PAG_COMMIT (0x00000010)
OBJ_ANY indicates that the memory may be allocated anywhere in the available virtual address space. In OS/2 Warp Server for SMP, OBJ_ANY memory allocations will first be attempted in the high memory area, which is the area of the virtual address space above 512 MB. If there is insufficient memory to satisfy the request from the high memory area, the memory will be allocated in the first 512 MB of the address space. IBM reserves the right to change this allocation strategy in future releases of OS/2.
If a memory object is allocated in the high memory area above 512 MB, 16-bit programs will not be able to address or access the object.
Memory should be allocated with the OBJ_ANY attribute wherever possible, since it provides the most efficient use of both the per-process address space as well as the system-wide virtual memory resources. It is intended that an application would make infrequent requests for large blocks of memory using DosAllocMem and then use DosSubSetMem along with DosSubAllocMem and DosSubFreeMem to manage the memory.
The maximum amount of free space in the high memory area can be determined from a program by using the DosQuerySysInfo function.
For OBJ_TILE memory objects, the 16-bit selectors are allocated to map the 32-bit object at 64KB boundaries. The figure below shows how the 16-bit alias selectors map the 32-bit object.
32-bit 32-bit 16-bit alias Offset Object Selectors BaseAddress+000KB┌──────────────┐ ───── Sel │ │ BaseAddress+064KB├──────────────┤ ───── Sel+HugeInc │ │ BaseAddress+128KB├──────────────┤ ───── Sel+HugeInc*2 │ │ BaseAddress+192KB├──────────────┤ ───── Sel+HugeInc*3 │ │ HugeInc is the huge increment used for DosAllocHuge.
Desired Access Protection
PAG_EXECUTE (0x00000004)