[ros-diffs] [greatlrd] 25339: prepare for sync of zlib add malloc to usetup. it only will be use by zlib 1.2.3 when the sync is finish

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Sun Jan 7 16:11:58 CET 2007


Author: greatlrd
Date: Sun Jan  7 18:11:57 2007
New Revision: 25339

URL: http://svn.reactos.org/svn/reactos?rev=25339&view=rev
Log:
prepare for sync of zlib
add malloc to usetup. it only will be use by zlib 1.2.3 when the sync is finish

Modified:
    trunk/reactos/base/setup/usetup/cabinet.c

Modified: trunk/reactos/base/setup/usetup/cabinet.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/cabinet.c?rev=25339&r1=25338&r2=25339&view=diff
==============================================================================
--- trunk/reactos/base/setup/usetup/cabinet.c (original)
+++ trunk/reactos/base/setup/usetup/cabinet.c Sun Jan  7 18:11:57 2007
@@ -66,6 +66,20 @@
 
 
 /* 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)
 {




More information about the Ros-diffs mailing list