andremussche / scalemm

Fast scaling memory manager for Delphi
https://code.google.com/p/scalemm/
Other
98 stars 22 forks source link

64 bit bug #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When creating TThread on 64 bit. I get exception at lock cmpxchg16b [r8] in

//either 8-byte or 16-byte CAS, depending on the platform; destination must be 
propely aligned (8- or 16-byte)
function CAS(const oldData: pointer; oldReference: NativeInt; newData: pointer;
  newReference: NativeInt; var destination): boolean; overload;

I thought ScaleMM2 was 64 bit ready?

Original issue reported on code.google.com by shadestu...@gmail.com on 25 Jul 2014 at 12:16

GoogleCodeExporter commented 9 years ago
(I am back from vacation now)

Can you reproduce this in a small test application? Does it occur in the latest 
version?

Original comment by andre.mussche on 29 Jul 2014 at 5:48

GoogleCodeExporter commented 9 years ago
It all works! It seems it was some kind of alignment issue. You should add this 
information to wiki. It is very important.

Original comment by david.lo...@gmail.com on 29 Jul 2014 at 6:04

GoogleCodeExporter commented 9 years ago
how did you fix it?

Original comment by andre.mussche on 29 Jul 2014 at 6:15

GoogleCodeExporter commented 9 years ago
I think the alignment wasn't correctly set.

Original comment by david.lo...@gmail.com on 29 Jul 2014 at 8:16

GoogleCodeExporter commented 9 years ago
which alignment and where?

Original comment by andre.mussche on 29 Jul 2014 at 8:19

GoogleCodeExporter commented 9 years ago
{$DEFINE Align8Bytes} in smmOptions.inc

Original comment by david.lo...@gmail.com on 29 Jul 2014 at 9:03

GoogleCodeExporter commented 9 years ago
this was a manual change? because it automatically uses 16bytes alignment in 
case of 64bit:

{$IFDEF CPUX64}
  {$DEFINE Align16Bytes} 
{$ENDIF}

{$IFDEF Align16Bytes}
  {$UNDEF Align8Bytes}   
{$ENDIF}

Original comment by andre.mussche on 29 Jul 2014 at 12:11