-
Notifications
You must be signed in to change notification settings - Fork 372
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
include the CTxWitness structure in memory usage accounting #269
include the CTxWitness structure in memory usage accounting #269
Conversation
src/memusage.h
Outdated
@@ -38,8 +38,9 @@ template<typename X> static inline size_t DynamicUsage(X * const &v) { return 0; | |||
template<typename X> static inline size_t DynamicUsage(const X * const &v) { return 0; } | |||
|
|||
/** Compute the memory used for dynamically allocated but owned data structures. | |||
* For generic data types, this is *not* recursive. DynamicUsage(vector<vector<int> >) | |||
* will compute the memory used for the vector<int>'s, but not for the ints inside. |
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.
I think this comment is misleading at best. It does account for the array of ints ("the ints").
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.
oh, I just realized the example had nested vectors. allright, I'll revert this
7125df9
to
affbfad
Compare
src/core_memusage.h
Outdated
@@ -26,27 +26,49 @@ static inline size_t RecursiveDynamicUsage(const CTxOut& out) { | |||
return RecursiveDynamicUsage(out.scriptPubKey); | |||
} | |||
|
|||
//TODO Account for CTxWitness. | |||
static inline size_t RecursiveDynamicUsage(const CTxInWitness& wit) { |
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.
all these static
are redundant, I copied them for symmetry, though they should probably be removed.
affbfad
to
88d0488
Compare
88d0488
to
fb37954
Compare
tACK fb37954
became
Follow-on PR could be to account for non-witness issuance data. |
fb37954 include the CTxWitness structure in memory usage accounting. (Arvid Norberg)
Also fixed comment in memusage.h