-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[io] Add ROOT::Internal::DumpBin(TMemFile&) for debugging purposes #20628
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
base: master
Are you sure you want to change the base?
Conversation
jblomer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Perhaps better implemented as ROOT::Internal::DumpBin(TMemFile &) in order to not increase the public interface.
1d8c337 to
8eb21db
Compare
Test Results 21 files 21 suites 3d 13h 54m 47s ⏱️ For more details on these failures, see this check. Results for commit 8eb21db. |
| /// FILE *out = fopen("memfile_dump.root", "wb"); | ||
| /// ROOT::Internal::DumpBin(memFile, out); | ||
| /// fclose(out); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the advantage of requiring the 3 steps instead of folding them into the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly the ability to pass stdout or similar, which would be more awkward to do with a string argument.
Also one may potentially want to dump multiple MemFiles to the same output, though that's probably rare.
pcanal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This Pull request:
adds a method to
TMemFilethat allows to dump the current contents of the memory blocks to file. Differently fromCp, it does not modify the contents in any way, so it's useful/meant to be used for debugging.The doc comment clarifies that
Cpshould still be preferred for regular use cases.