This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Addition to the testsuite & cygwin patch
- From: "Pierre A. Humblet" <pierre at phumblet dot no-ip dot org>
- To: <cygwin-patches at cygwin dot com>
- Date: Tue, 09 May 2006 18:11:50 -0400
- Subject: Addition to the testsuite & cygwin patch
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 Pierre.Humblet@ieee.org
* winsup.api/malloc.c: New file
2006-05-09 Pierre Humblet Pierre.Humblet@ieee.org
* 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