Changed to a separat heap for malloc/calloc/realloc/free.
authorHartmut Birr <osexpert@googlemail.com>
Mon, 1 Apr 2002 22:03:13 +0000 (22:03 +0000)
committerHartmut Birr <osexpert@googlemail.com>
Mon, 1 Apr 2002 22:03:13 +0000 (22:03 +0000)
svn path=/trunk/; revision=2806

reactos/lib/msvcrt/stdlib/malloc.c

index 50db1d4..8353267 100644 (file)
@@ -1,23 +1,24 @@
 #include <windows.h>
 #include <msvcrt/stdlib.h>
 
+extern HANDLE hHeap;
 
 void* malloc(size_t _size)
 {
-   return(HeapAlloc(GetProcessHeap(),0,_size));
+   return HeapAlloc(hHeap, HEAP_ZERO_MEMORY, _size);
 }
 
 void free(void* _ptr)
 {
-   HeapFree(GetProcessHeap(),0,_ptr);
+   HeapFree(hHeap,0,_ptr);
 }
 
 void* calloc(size_t _nmemb, size_t _size)
 {
-   return(HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, _nmemb*_size));
+   return HeapAlloc(hHeap, HEAP_ZERO_MEMORY, _nmemb*_size);
 }
 
 void* realloc(void* _ptr, size_t _size)
-{
-   return(HeapReAlloc(GetProcessHeap(),0,_ptr,_size));
+{ 
+   return HeapReAlloc(hHeap, 0, _ptr, _size);
 }