mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
Changed to a separat heap for malloc/calloc/realloc/free.
svn path=/trunk/; revision=2806
This commit is contained in:
parent
ae374594ce
commit
7497838509
1 changed files with 6 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue