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:
Magnus Olsen 2007-01-07 15:11:57 +00:00
parent e91d8b9c37
commit 3280f62148

View file

@ -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);