The main purpose of this patch is to contribute the attached file to
testsuite/winsup.api. It checks that Cygwin can support a user
supplied version of malloc.
However the patch below is required to make it work and to
support versions of malloc that don't call sbrk.

Pierre

2006-05-09  Pierre Humblet  [EMAIL PROTECTED]

   * winsup.api/malloc.c: New file

2006-05-09  Pierre Humblet  [EMAIL PROTECTED]

* heap.cc (heap_init): Only commit if allocsize is not zero.

Index: heap.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/heap.cc,v
retrieving revision 1.52
diff -u -p -b -r1.52 heap.cc
--- heap.cc     13 Mar 2006 21:10:14 -0000      1.52
+++ heap.cc     9 May 2006 21:47:40 -0000
@@ -83,7 +83,7 @@ heap_init ()
                  reserve_size, allocsize, page_const);
      if (p != cygheap->user_heap.base)
api_fatal ("heap allocated at wrong address %p (mapped) != %p (expected)", p, cygheap->user_heap.base); - if (!VirtualAlloc (cygheap->user_heap.base, allocsize, MEM_COMMIT, PAGE_READWRITE)) + if (allocsize && !VirtualAlloc (cygheap->user_heap.base, allocsize, MEM_COMMIT, PAGE_READWRITE))
       api_fatal ("MEM_COMMIT failed, %E");
    }

Attachment: malloc.c
Description: Binary data

Reply via email to