pleriche / FastMM4

A memory manager for Delphi and C++ Builder with powerful debugging facilities
446 stars 157 forks source link

Question for optimisation code #60

Open mlcvista opened 6 years ago

mlcvista commented 6 years ago

Hello,

I've see in fastmm4.pas code a line (12167) like :

procedure AppendMemorySize(ASize: NativeUInt); begin if ASize < 10*1024 then….

I Wonder if this could be replcaced by

procedure AppendMemorySize(ASize: NativeUInt); begin if ASize < 10240 then…

That should be more faster… If it's correct can we Apply this to other case like this one… ? (ex : 10x1024x1024 replaced by 10485760...)

With best regards, MLCVISTA

mahotilo commented 6 years ago

There is no need to do this. The compiler will perform this optimization. You can check it at the breakpoint in the CPU view. But since the code is more convenient for reading and understanding.

mlcvista commented 6 years ago

Big thank you Maholito 👍

baka0815 commented 6 years ago

I think this can be closed.