From b06cec2ffd04579631dfcfaeacabc3945699ccf0 Mon Sep 17 00:00:00 2001 From: Gregor Schneider Date: Sat, 28 Nov 2009 15:13:18 +0000 Subject: [PATCH] [msvcrt] - Use the process heap for malloc and friends - Fixes a crash during GIMP startup (bug #3503, part 1) svn path=/trunk/; revision=44306 --- reactos/lib/sdk/crt/stdlib/malloc.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/reactos/lib/sdk/crt/stdlib/malloc.c b/reactos/lib/sdk/crt/stdlib/malloc.c index 71f2d492f94..65163ae496d 100644 --- a/reactos/lib/sdk/crt/stdlib/malloc.c +++ b/reactos/lib/sdk/crt/stdlib/malloc.c @@ -34,8 +34,6 @@ /* round to 16 bytes + alloc at minimum 16 bytes */ #define ROUND_SIZE(size) (max(16, ROUND_UP(size, 16))) -extern HANDLE hHeap; - /* * @implemented */ @@ -46,7 +44,7 @@ void* malloc(size_t _size) if (nSize<_size) return NULL; - return HeapAlloc(hHeap, 0, nSize); + return HeapAlloc(GetProcessHeap(), 0, nSize); } /* @@ -54,7 +52,7 @@ void* malloc(size_t _size) */ void free(void* _ptr) { - HeapFree(hHeap,0,_ptr); + HeapFree(GetProcessHeap(),0,_ptr); } /* @@ -68,7 +66,7 @@ void* calloc(size_t _nmemb, size_t _size) if ( (_nmemb > ((size_t)-1 / _size)) || (cSize