Skip to content

[tmva][sofie] Remove unsafe RModel::AddOperatorReference interface#21456

Merged
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:add_operator
Mar 3, 2026
Merged

[tmva][sofie] Remove unsafe RModel::AddOperatorReference interface#21456
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:add_operator

Conversation

@guitargeek
Copy link
Contributor

The RModel::AddOperatorReference() function is not memory safe, because it takes ownership of an argument passed by raw pointer. It's better to remove these kind of functions (possible because SOFIE is still in the experimental namespace), and use the safe alternative that take a std::unique_ptr instead, for clear ownership semantics.

The `RModel::AddOperatorReference()` function is not memory safe,
because it takes ownership of an argument passed by raw pointer. It's
better to remove these kind of functions (possible because SOFIE is
still in the experimental namespace), and use the safe alternative that
take a `std::unique_ptr` instead, for clear ownership semantics.
@guitargeek guitargeek self-assigned this Mar 2, 2026
@guitargeek guitargeek requested a review from lmoneta as a code owner March 2, 2026 18:49
@guitargeek guitargeek requested a review from vepadulano as a code owner March 2, 2026 18:49
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Test Results

    22 files      22 suites   3d 2h 3m 28s ⏱️
 3 805 tests  3 804 ✅ 1 💤 0 ❌
75 684 runs  75 675 ✅ 9 💤 0 ❌

Results for commit 086e092.

Copy link
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

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

Thank you Jonas for fixing this.
AddOperatorReference was added for Python, but your solution is a better one.

@guitargeek guitargeek merged commit 9f414f5 into root-project:master Mar 3, 2026
33 checks passed
@guitargeek guitargeek deleted the add_operator branch March 3, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants