On Tue, 18 Jun 2024, Benito van der Zander via fpc-pascal wrote:
Hi,
This field was introduced for Delphi compatibility:
The implementation of TMonitor requires this data.
Delphi has this field as well but "hides" the field behind all other
actually declared fields.
If you examine the actual memory size allocated for TObject, you'll see
that an extra field is actually present.
that is bad news
Now all objects become 8 bytes larger?
In 64-bit, yes. Same size as in Delphi.
Could this not use a global hashmap with tobject as key?
Alas no, too slow. TMonitor is supposed to be faster than a lock object
(although I have my doubts if this is achieved even in Delphi).
Can't have a hash lookup then.
If you don't want to use TMonitor, you can recompile the RTL with
OPT=-dFPC_DISABLE_MONITOR then none of this is included:
The FPC rtl itself does not use TMonitor.
Michael.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal