diff options
Diffstat (limited to 'winsup/cygwin/heap.cc')
-rw-r--r-- | winsup/cygwin/heap.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/winsup/cygwin/heap.cc b/winsup/cygwin/heap.cc index 5c301cc..139b1d5 100644 --- a/winsup/cygwin/heap.cc +++ b/winsup/cygwin/heap.cc @@ -68,7 +68,7 @@ heap_init () /* Initialize page mask and default heap size. Preallocate a heap * to assure contiguous memory. */ cygheap->heapptr = cygheap->heaptop = cygheap->heapbase = - VirtualAlloc(NULL, cygwin_shared->heap_chunk_size (), MEM_RESERVE, + VirtualAlloc (NULL, cygwin_shared->heap_chunk_size (), MEM_RESERVE, PAGE_NOACCESS); if (cygheap->heapbase == NULL) api_fatal ("2. unable to allocate heap, heap_chunk_size %d, %E", @@ -86,7 +86,7 @@ heap_init () /* FIXME: This function no longer handles "split heaps". */ extern "C" void * -_sbrk(int n) +_sbrk (int n) { sigframe thisframe (mainthread); char *newtop, *newbrk; @@ -104,21 +104,21 @@ _sbrk(int n) if (n < 0) { /* Freeing memory */ - assert(newtop < cygheap->heaptop); + assert (newtop < cygheap->heaptop); n = (char *) cygheap->heaptop - newtop; - if (VirtualFree(newtop, n, MEM_DECOMMIT)) /* Give it back to OS */ + if (VirtualFree (newtop, n, MEM_DECOMMIT)) /* Give it back to OS */ goto good; /* Didn't take */ else goto err; } - assert(newtop > cygheap->heaptop); + assert (newtop > cygheap->heaptop); /* Need to grab more pages from the OS. If this fails it may be because * we have used up previously reserved memory. Or, we're just plumb out * of memory. */ commitbytes = pround (newtop - (char *) cygheap->heaptop); - if (VirtualAlloc(cygheap->heaptop, commitbytes, MEM_COMMIT, PAGE_READWRITE) != NULL) + if (VirtualAlloc (cygheap->heaptop, commitbytes, MEM_COMMIT, PAGE_READWRITE) != NULL) goto good; /* Couldn't allocate memory. Maybe we can reserve some more. @@ -128,8 +128,8 @@ _sbrk(int n) if ((newbrksize = cygwin_shared->heap_chunk_size ()) < commitbytes) newbrksize = commitbytes; - if ((VirtualAlloc(cygheap->heaptop, newbrksize, MEM_RESERVE, PAGE_NOACCESS) != NULL) && - (VirtualAlloc(cygheap->heaptop, commitbytes, MEM_COMMIT, PAGE_READWRITE) != NULL)) + if ((VirtualAlloc (cygheap->heaptop, newbrksize, MEM_RESERVE, PAGE_NOACCESS) != NULL) && + (VirtualAlloc (cygheap->heaptop, commitbytes, MEM_COMMIT, PAGE_READWRITE) != NULL)) goto good; err: |