FastMM is not usable in C++Builder 10.1 Berlin.
With the new Win32 clang compiler, FastMM4BCB.cpp compiles but throws an access violation on program start:
exception class $C0000005 with message 'access violation at 0x004090d6: read of address 0xfffffffc'
which happens in FastMM4.pas line 6479:
LBlockHeader := PNativeUInt(PByte(APointer) - BlockHeaderSize)^;
An error reading from address 0xfffffffc means BlockHeaderSize is 4 and APointer is nil.
With the classic Win32 compiler, FastMM4BCB.cpp does not compile at all:
[bcc32 Error] typeinfo.h(154): E2367 Can't inherit RTTI class from non-RTTI base 'exception'
[bcc32 Error] xlocale(664): E2238 Multiple declaration for 'codecvt<char16_t,char,int>::in(int &,const char ,const char ,const char * &,char16_t ,char16_t ,char16_t * &) const'
[bcc32 Error] xlocale(542): E2344 Earlier declaration of 'codecvt<char16_t,char,int>::in(int &,const char ,const char ,const char * &,char16_t ,char16_t ,char16_t * &) const'
In FastMM4BCB.cpp, change lines 507, 508 to the following:
It seems that the clang compiler is not expecting the naked stubs
__declspec(naked)
as they're picked up in the current code. Once I changed those lines I'm able to compile FastMM with bcc32c in Berlin Update 1, and get normal results. There may be 'other' issues, but so far it seems to work fine.