File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -761,8 +761,8 @@ procedure NotifyMediumLargeFree(var Arena: TMMStatusArena; Size: PtrUInt);
761
761
const
762
762
// (sometimes) the more arenas, the better multi-threadable
763
763
{ $ifdef FPCMM_BOOSTER}
764
- NumTinyBlockTypesPO2 = 4 ;
765
- NumTinyBlockArenasPO2 = 4 ; // will probably end up with Medium lock contention
764
+ NumTinyBlockTypesPO2 = 4 ; // tiny are <= 256 bytes
765
+ NumTinyBlockArenasPO2 = 4 ; // 16 arenas
766
766
{ $else}
767
767
{ $ifdef FPCMM_BOOST}
768
768
NumTinyBlockTypesPO2 = 4 ; // tiny are <= 256 bytes
@@ -988,7 +988,7 @@ procedure GetSmallLockLessFreeBlock; nostackframe; assembler;
988
988
xor ecx, ecx
989
989
xchg [rbx].TSmallBlockType.LockLessFree, rcx // atomic rcx = to free
990
990
test rcx, rcx
991
- jz @Done2
991
+ jz @Done2 // slot used by another thread in-between
992
992
mov r10, [rcx]
993
993
test r10, r10 // r10 = new head = the one following rcx
994
994
jz @Done
@@ -1509,7 +1509,10 @@ function _GetMem(size: PtrUInt): pointer;
1509
1509
mov dl, NumTinyBlockArenas + 1 // 8/16 arenas (including Small[])
1510
1510
@TinyBlockArenaLoop:
1511
1511
mov eax, SizeOf(TTinyBlockTypes)
1512
- // note: "lock xadd" decreases the loop iterations but is slower
1512
+ // "lock xadd" decreases loop iterations but is slower on normal load
1513
+ { $ifdef FPCMM_BOOST}
1514
+ lock
1515
+ { $endif FPCMM_BOOST}
1513
1516
xadd dword ptr [r8 + TSmallBlockInfo.TinyCurrentArena], eax
1514
1517
lea rbx, [r8 + rcx]
1515
1518
and eax, ((NumTinyBlockArenas + 1 ) * SizeOf(TTinyBlockTypes)) - 1
Original file line number Diff line number Diff line change 1
- '2.0.4819 '
1
+ '2.0.4820 '
You can’t perform that action at this time.
0 commit comments