Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions FastMM5.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4243,6 +4243,14 @@ procedure FillFreedDebugBlockWithDebugPattern(APDebugBlockHeader: PFastMM_DebugB
LByteOffset := APDebugBlockHeader.UserSize;
LPUserArea := PByte(APDebugBlockHeader) + CDebugBlockHeaderSize;

{Use FillChar above the measured crossover and retain the scalar path for smaller blocks.}
if LByteOffset >= 40 then
begin
FillChar(LPUserArea^, LByteOffset, CDebugFillByteFreedBlock);
PPointerArray(LPUserArea)[0] := TFastMM_FreedObject;
Exit;
end;

{Store a pointer to the freed object class if the block is large enough.}
if LByteOffset >= CTObjectInstanceSize then
begin
Expand Down Expand Up @@ -4290,6 +4298,13 @@ procedure FillAllocatedDebugBlockWithDebugPattern(APDebugBlockHeader: PFastMM_De
LByteOffset := APDebugBlockHeader.UserSize;
LPUserArea := PByte(APDebugBlockHeader) + CDebugBlockHeaderSize;

{Use FillChar above the measured crossover and retain the scalar path for smaller blocks.}
if LByteOffset >= 40 then
begin
FillChar(LPUserArea^, LByteOffset, CDebugFillByteAllocatedBlock);
Exit;
end;

if LByteOffset and 1 <> 0 then
begin
Dec(LByteOffset);
Expand Down