ntpsec | Converted stat_count struct to a module level global. (!1026)
Gary E. Miller
gem at rellim.com
Wed Aug 28 20:02:51 UTC 2019
Yo Hal!
On Wed, 28 Aug 2019 12:56:33 -0700
Hal Murray via devel <devel at ntpsec.org> wrote:
> ianbruene at gmail.com said:
> > It is reducing unnecessary globals because globals are a good thing
> > to reduce.
>
> In general, I agree that reducing globals is a good idea. It's not
> globals that are evil, it's the complexity they normally introduce.
>
> It's not clear that replacing a global with a procedure to read it
> reduces that complexity when the counter is a simple counter.
So replacing a global variable name with a global function name. No
win there. Plus the speed loss of calling a function for a simple task,
load time link computations, etc.
Possibly justified if some sort of locking or memory barrier is also
paired with the counter functions.
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
gem at rellim.com Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20190828/309c0015/attachment.bin>
More information about the devel
mailing list