Skip to content

Conversation

@SeanAlling-DojoFive
Copy link
Contributor

Blocked by PR #48

Start migrating code when applicable to:

  1. Use smart pointers
  2. Container objects

Goal is to reduce call of new/delete within source code.

To help validate a branch utilizing Valgrind was created. Cherry pick commit as needed for testing.

Running CTest configured for Valgrind will take significantly longer than normal to run.

Copy link
Owner

@sierrafoxtrot sierrafoxtrot left a comment

Choose a reason for hiding this comment

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

Thanks Sean. Definitely keen to move adler to smart pointers but I had some thoughts on the overall approach. Some comments made which describe those.

Happy to tackle when you've had a chance to rebase/merge of course.

*/
~memory_walker_adler16() override = default;

private:
Copy link
Owner

Choose a reason for hiding this comment

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

This inclusion of private here is intentional. The idea is that the headers are written from a template and in a very structured way. Rather than mysteriously move the constructor to the bottom of the header, it's left in the usual spot as a prompt (to the lib user especially) that the create method should be used.

*/
~memory_walker_adler32() override = default;

private:
Copy link
Owner

Choose a reason for hiding this comment

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

This is intentional, same as in adler16.h above.

//
memory_walker_adler32::pointer w =
memory_walker_adler32::create();
auto w = std::make_shared<memory_walker_adler32>();
Copy link
Owner

Choose a reason for hiding this comment

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

Definitely keen to move to smart pointers. I should have picked these up when I moved from boost to std share pointers elsewhere.

However, I'd rather move the creation of the smart pointer into the create method in the class(es). My worry is that someone using libsrecord won't get the benefit or more importantly may mix smart and non-smart pointers if they are using base and library code from the project.

@sierrafoxtrot
Copy link
Owner

Hi Sean. Apologies for falling behind but did you still want to move forward with this one?

@SeanAlling-DojoFive
Copy link
Contributor Author

I have been a little busy with life events recently. Will be coming back to this in a couple weeks.

@sierrafoxtrot
Copy link
Owner

Completely understand. Nothing but empathy from me on that one. I hope all is well.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants