Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SafeMM for Delphi XE2

Has anyone ported the SafeMM debugging memory manager to Delphi XE2? The 2009 SafeMM on CodeCentral won't compile because the RTL now uses NativeInt instead of Integer for the memory functions.

like image 870
Jan Goyvaerts Avatar asked Jan 06 '12 01:01

Jan Goyvaerts


1 Answers

I've uploaded my Delphi XE2 port of SafeMM to CodeCentral. I've verified that it correctly allocates blocks larger than 4 GB and that it can allocate more than 4 GB worth of smaller blocks when used in a Win64 application and that it still works correctly in Win32 applications.

I've updated my CodeCentral submission on 7 July 2012 to fix a bug that causes SafeMM to crash when two threads try to free a large block (> 4KB) at the same time. This bug was introduced in version 0.3 of SafeMM by its original developer. If you're using this version of SafeMM with an older version of Delphi, you'll need to wrap the code in FreeLargeBlock in a critical section as I did in my version.

like image 152
Jan Goyvaerts Avatar answered Nov 02 '22 20:11

Jan Goyvaerts