Skip to content

Conversation

@yadij
Copy link
Contributor

@yadij yadij commented Oct 23, 2025

No description provided.

@yadij
Copy link
Contributor Author

yadij commented Oct 23, 2025

Steps 1 (use MEMPROXY for new/delete) and 2 (C++11 initialization and constructor)
of a long refactor to replace the MIB tree with STL container(s) and RAII memory management.

Copy link
Contributor

@rousskov rousskov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several other change requests also avoid in-class initialization of members that must be initialized via class constructor (assuming that they must be). In this and other PRs, let's give compiler a chance to warn us if we forget to initialize such members while refactoring object construction code.

@yadij yadij requested a review from rousskov October 23, 2025 18:11
yadij and others added 2 commits October 24, 2025 11:02
Co-authored-by: Alex Rousskov <rousskov@measurement-factory.com>
@yadij yadij added the S-waiting-for-reviewer ready for review: Set this when requesting a (re)review using GitHub PR Reviewers box label Oct 24, 2025
entry->len = len;
const auto entry = new mib_tree_entry(name, len, aggrType);
entry->parsefunction = parsefunction;
entry->instancefunction = instancefunction;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any specific reasons for not including parsefunction and instancefunction in the constructor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplicity for now. Later refactor steps will change them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does done look like with the later refactor steps?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does done look like with the later refactor steps?

I suspect there will be two mib_tree_entry constructors, one setting (constant) parse/instance functions and one prohibiting them. Or two C++ class types to differentiate the two use cases. Or perhaps a lot more classes, with those functions converted to class methods. Delaying that non-trivial refactoring may be the right decision, but I have not studied all the necessary details to be sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-for-reviewer ready for review: Set this when requesting a (re)review using GitHub PR Reviewers box

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants