mirror of
https://github.com/reactos/reactos.git
synced 2025-01-13 01:22:03 +00:00
prepare for sync of zlib
add malloc to usetup. it only will be use by zlib 1.2.3 when the sync is finish svn path=/trunk/; revision=25339
This commit is contained in:
parent
e91d8b9c37
commit
3280f62148
1 changed files with 14 additions and 0 deletions
|
@ -67,6 +67,20 @@ static PVOID CabinetReservedArea = NULL;
|
|||
|
||||
/* Needed by zlib, but we don't want the dependency on msvcrt.dll */
|
||||
|
||||
/* round to 16 bytes + alloc at minimum 16 bytes */
|
||||
#define ROUND_SIZE(size) (max(16, ROUND_UP(size, 16)))
|
||||
|
||||
void* __cdecl malloc(size_t _size)
|
||||
{
|
||||
size_t nSize = ROUND_SIZE(_size);
|
||||
|
||||
if (nSize<_size)
|
||||
return NULL;
|
||||
|
||||
return RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, nSize);
|
||||
}
|
||||
|
||||
|
||||
void __cdecl free(void* _ptr)
|
||||
{
|
||||
RtlFreeHeap(ProcessHeap, 0, _ptr);
|
||||
|
|
Loading…
Reference in a new issue