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:
parent
bf37050f94
commit
0204fa906c
@ -245,6 +245,7 @@ void * __restrict FastAlloc::_Allocate(size_t dwSize)
|
|||||||
}
|
}
|
||||||
pool = &poollist[(PtrTo32(lpMemory)>>16)&0xFF];
|
pool = &poollist[(PtrTo32(lpMemory)>>16)&0xFF];
|
||||||
|
|
||||||
|
assert(pool->blocksUsed == 0)
|
||||||
pool->blocksUsed = 1;
|
pool->blocksUsed = 1;
|
||||||
pool->bytesTotal = dwSize;
|
pool->bytesTotal = dwSize;
|
||||||
pool->lpMem = lpMemory;
|
pool->lpMem = lpMemory;
|
||||||
|
@ -107,7 +107,11 @@ void STDCALL ResetXTAllocator(CTSTR lpAllocator)
|
|||||||
else if (scmpi(lpAllocator, TEXT("SeriousMemoryDebuggingAlloc")) == 0)
|
else if (scmpi(lpAllocator, TEXT("SeriousMemoryDebuggingAlloc")) == 0)
|
||||||
MainAllocator = new SeriousMemoryDebuggingAlloc;
|
MainAllocator = new SeriousMemoryDebuggingAlloc;
|
||||||
else
|
else
|
||||||
|
#if defined(_M_X64) || defined(__amd64__)
|
||||||
|
MainAllocator = new DefaultAlloc;
|
||||||
|
#else
|
||||||
MainAllocator = new FastAlloc;
|
MainAllocator = new FastAlloc;
|
||||||
|
#endif
|
||||||
|
|
||||||
locale = new LocaleStringLookup;
|
locale = new LocaleStringLookup;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user