Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[c++] Address final valgrind issue #2403

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

eddelbuettel
Copy link
Contributor

Issue and/or context:

When running under valgrind (by for example calling an R script or expression and starting as R -q -d valgrind) and with the proper memcheck instrumentation for chasing leaks, we were reminded that we lost a small fixed amoumt of 248 bytes per column retrieved. This was due to allocating the (opaque) private_data by default and then (as we do here for buffer management) store the ArrowBuffer / ColumnBuffer container handle.

Changes:

By freeing the default allocation before assigning, we no longer leak. We also removed another small assignment (and helper function used) taken care of now by nanoarrow following #2188.

Notes for Reviewer:

SC 44774

Copy link
Member

@gspowley gspowley left a comment

Choose a reason for hiding this comment

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

LGTM. Nice catch.

@eddelbuettel
Copy link
Contributor Author

Thanks! It's all valgrind.

And I still fail at my 'pro license' as I once again forgot the value-add provided by clang-format-14.

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

Merging #2403 (c1befef) into main (95e3156) will increase coverage by 24.53%.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2403       +/-   ##
===========================================
+ Coverage   66.07%   90.61%   +24.53%     
===========================================
  Files         144       37      -107     
  Lines       13006     3900     -9106     
  Branches      511        0      -511     
===========================================
- Hits         8594     3534     -5060     
+ Misses       4312      366     -3946     
+ Partials      100        0      -100     
Flag Coverage Δ
libtiledbsoma ?
python 90.61% <ø> (ø)
r ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
python_api 90.61% <ø> (ø)
libtiledbsoma ∅ <ø> (∅)

@eddelbuettel eddelbuettel merged commit e0e3fa4 into main Apr 8, 2024
15 checks passed
@eddelbuettel eddelbuettel deleted the de/sc-44774/final_valgrind_issue branch April 8, 2024 17:32
github-actions bot pushed a commit that referenced this pull request Apr 8, 2024
* Release (default) allocation of private_data before point to ours

* Remove unnecessary buffer set up done by nanoarrow

Also removes one function no longer needed

* White-space only commit because of clang-format
johnkerl pushed a commit that referenced this pull request Apr 8, 2024
* Release (default) allocation of private_data before point to ours

* Remove unnecessary buffer set up done by nanoarrow

Also removes one function no longer needed

* White-space only commit because of clang-format

Co-authored-by: Dirk Eddelbuettel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants