Disable FastAlloc for 64 bit builds

FastAlloc only uses the lower 32 bits of a pointer to index its internal
structures which is a problem for allocations with size >= 0x8001,
because multiple big allocations can have the same values for bit 16 to
bit 32, which causes FastAlloc to discard its info about the previous
allocation
This commit is contained in:
palana 2014-08-17 20:16:03 +02:00
parent bf37050f94
commit 0204fa906c
2 changed files with 5 additions and 0 deletions

View File

@ -245,6 +245,7 @@ void * __restrict FastAlloc::_Allocate(size_t dwSize)
}
pool = &poollist[(PtrTo32(lpMemory)>>16)&0xFF];
assert(pool->blocksUsed == 0)
pool->blocksUsed = 1;
pool->bytesTotal = dwSize;
pool->lpMem = lpMemory;

View File

@ -107,7 +107,11 @@ void STDCALL ResetXTAllocator(CTSTR lpAllocator)
else if (scmpi(lpAllocator, TEXT("SeriousMemoryDebuggingAlloc")) == 0)
MainAllocator = new SeriousMemoryDebuggingAlloc;
else
#if defined(_M_X64) || defined(__amd64__)
MainAllocator = new DefaultAlloc;
#else
MainAllocator = new FastAlloc;
#endif
locale = new LocaleStringLookup;