Am 26.03.2011 10:15, schrieb Hans-Peter Diettrich:
Graeme Geldenhuys schrieb:
[fpc] should rather use some singleton class with a read-only
property,
A class is not required, FPC supports unit-level properties as well :-)
True, but the issue with them is: you cannot use them to create a fool
proof read-only property without using a function because there is no
unit level encapsulation aka private/protected on unit level: the
variable read by the property cannot be in the implementation part of
the unit because it wouldn't be accessible at declaration time of the
property.
Making IsMultiThreaded a function is a no-no: it is used in really speed
critical code paths and using an inline function neither because it's
used mostly in assembler code in the rtl like:
if ismultithreaded then
<do things locked>
else
<do things without locking>
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus