Skip to content

[ntuple] Fix memory management on read of std::vector elements#9152

Merged
jblomer merged 1 commit intoroot-project:masterfrom
jblomer:ntuple-9133
Oct 20, 2021
Merged

[ntuple] Fix memory management on read of std::vector elements#9152
jblomer merged 1 commit intoroot-project:masterfrom
jblomer:ntuple-9133

Conversation

@jblomer
Copy link
Copy Markdown
Contributor

@jblomer jblomer commented Oct 20, 2021

The problem of constructor and destructor calls when reading std::vector of non-trivial types has come up in #8770. This fixes #9133.

To me it looks like we would benefit from storing information about trivially constructable/destructable types in the RField class. @jalopezg-r00t @eguiraud @pcanal Let me know what you think.

@jblomer jblomer self-assigned this Oct 20, 2021
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu2004/soversion, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on mac11.0/cxx17.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@pcanal
Copy link
Copy Markdown
Member

pcanal commented Oct 20, 2021

@jblomer In TTree, it was found useful to let the user decide in the end whether to run the destructor or not. If the trivially does not indicate it is not necessary/needed, having a non-trivial destructor does not always (albeit often) indicates that it needs to be run (only the user/actual-code can tell us). So we would probably need to flag to default to 'run-the-destructor-only-if-not-trivial" but let the user over-ride it.

@jblomer jblomer merged commit 261f358 into root-project:master Oct 20, 2021
@jblomer jblomer deleted the ntuple-9133 branch October 20, 2021 22:44
@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2021-10-20T22:53:22.906Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1045 (message):

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.

[ntuple] Memory leak when reading std::vector of complex objects

3 participants