mirror of
https://github.com/halpz/re3.git
synced 2025-07-17 09:28:16 +00:00
Merge branch 'master' into miami
# Conflicts: # premake5.lua # src/peds/Ped.cpp # src/peds/PedIK.cpp # src/peds/PedIK.h
This commit is contained in:
@ -60,6 +60,16 @@ void FlushObrsPrintfs()
|
||||
void *
|
||||
RwMallocAlign(RwUInt32 size, RwUInt32 align)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
uintptr ptralign = align-1;
|
||||
void *mem = (void *)malloc(size + sizeof(uintptr) + ptralign);
|
||||
|
||||
ASSERT(mem != nil);
|
||||
|
||||
void *addr = (void *)((((uintptr)mem) + sizeof(uintptr) + ptralign) & ~ptralign);
|
||||
|
||||
ASSERT(addr != nil);
|
||||
#else
|
||||
void *mem = (void *)malloc(size + align);
|
||||
|
||||
ASSERT(mem != nil);
|
||||
@ -67,6 +77,7 @@ RwMallocAlign(RwUInt32 size, RwUInt32 align)
|
||||
void *addr = (void *)((((uintptr)mem) + align) & ~(align - 1));
|
||||
|
||||
ASSERT(addr != nil);
|
||||
#endif
|
||||
|
||||
*(((void **)addr) - 1) = mem;
|
||||
|
||||
|
Reference in New Issue
Block a user