Ignore:
Timestamp:
Oct 6, 2001, 9:08:03 PM (24 years ago)
Author:
sandervl
Message:

allocate in 64kb units

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/os2heap.cpp

    r6954 r6957  
    1 /* $Id: os2heap.cpp,v 1.24 2001-10-06 18:53:11 sandervl Exp $ */
     1/* $Id: os2heap.cpp,v 1.25 2001-10-06 19:08:03 sandervl Exp $ */
    22
    33/*
     
    320320  dprintf(("KERNEL32: getmoreHeapMem(%08xh, %08xh, %08xh)", pHeap, *size, *clean));
    321321
    322   /* round the size up to a multiple of 4K */
    323   *size = (*size / 4096) * 4096 + 4096;
     322  /* round the size up to a multiple of 64K */
     323  //NOTE: MUST use 64kb here or else we are at risk of running out of virtual
     324  //      memory space. (when allocating 4kb we actually get 4kb + 60k uncommited)
     325  *size = (*size / 65536) * 65536 + 65536;
    324326
    325327  rc = DosAllocMem(&newblock, *size, flAllocMem|PAG_READ|PAG_WRITE|PAG_COMMIT|PAG_EXECUTE);
     
    328330        return FALSE;
    329331  }
    330 success:
    331332  *clean = _BLOCK_CLEAN;
    332333  dprintf(("KERNEL32: getmoreHeapMem %x %d", newblock, *size));
Note: See TracChangeset for help on using the changeset viewer.