라벨이 allocate인 게시물 표시

OS/2 codes: How to allocate in high-memory area

By default, OS/2 allocates a memory in low-memory area, which is below 512 MB. However, nowadays, more and more applications requires more and more memory. Fortunately, OS/2 provides ways to allocate in high-memory area, which is above 512 MB. In this case, applications can use much more memory limited by VIRTUALADDRESSLIMIT and physical memory + swap memory. So if possible, it would be better to try to allocate in high-memory area first. Now, let's see the ways to allocate in a high-memory. 1. DosAllocMem() with OBJ_ANY First is to use OS/2 API DosAllocMem() . DosAllocMem() provides a flag to allocate in high-memory area. It's OBJ_ANY . Following is an example. Colored By Color Scripter ™ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 /* highmem1.c */ #define  INCL_DOS #include  <os2.h> #include  <stdio.h> int  main(  void  ) {     PVOID p;     APIRET...