From c90e1cf179187d5d188a3003db503ffd86d80cfe Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 22 Sep 2002 03:38:57 +0000 Subject: * fhandler.cc (fhandler_base::dup): Don't set handle on failure. Caller has already taken care of that. * fhandler_console.cc (fhandler_console::open): Initialize handles to NULL. (fhandler_console::close): Ditto. GNUify non-GNU formatted functions calls throughout. --- winsup/cygwin/heap.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'winsup/cygwin/heap.cc') diff --git a/winsup/cygwin/heap.cc b/winsup/cygwin/heap.cc index 5c301cc16..139b1d5a0 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: -- cgit v1.2.3