Preliminary report on variable initialization, and when does code freeze happen?
Ian Bruene
ianbruene at gmail.com
Sun May 27 16:25:00 UTC 2018
I have done a scan over the variables that I have already structified in
recent weeks to see where they get initialized.
Most of the variables I have checked get initialized either at
definition time, or in some sort of init_foo() function. I found three
variables that are never initialized:
* sys_vars.sys_rootdist
* mon_data.mru_entries
* mon_data.mru_peakentries
sys_rootdist was only recently added to the code, its entire purpose is
to funnel data to mode 6. I believe this could be safely initialized to
0 with issue.
mru_entries is incremented and decremented, but is only ever assigned in
mon_stop(). As I understand it it is only through dumb luck that this is
ever correct. I believe it can be initialized to 0 without issue.
mru_peakentries is a counter, much like sys_rootdist I believe it can be
initialized to 0 without issue.
I can fix all three of these now. However I do not know when the pre-1.2
code freeze is happening and do not wish to make any further changes to
the C code until after SELF except as necessary.
There is also the larger question of do we want variables to be
initialized at definition or within an init_foo()? The code is not
consistent on this and appears to be in the middle of a transition in
some direction. I assume it is in the direction of initialization
functions, but I do not know.
--
/"In the end; what separates a Man, from a Slave? Money? Power? No. A
Man Chooses, a Slave Obeys."/ -- Andrew Ryan
/"Utopia cannot precede the Utopian. It will exist the moment we are fit
to occupy it."/ -- Sophia Lamb
I work for the Internet Civil Engineering Institute <https://icei.org/>,
help us save the Internet from Entropy!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20180527/7b7e681d/attachment.html>
More information about the devel
mailing list