-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Fix bug in memory usage calculation (unintended integer division) #12784
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
Conversation
|
ACK 490e8be. |
src/dbwrapper.cpp
Outdated
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.
Wouldn't replacing 1024 with 1024.0 here (and in the other case) have the same effect, but avoid the cast?
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.
@laanwj Absolutely! Now updated. Please re-review :-)
490e8be to
a16c6d2
Compare
|
ACK a16c6d2 I'm really tempted to add formatters for MiB and whatnot as a new format specifier in |
|
utACK a16c6d2 |
|
@eklitzke Formatters for MiB, etc sounds nice! |
|
utACK a16c6d2 |
I'd prefer not to make such changes to tinyformat.h locally. Unless you manage to upstream it (https://github.com/c42f/tinyformat), an utility function would be preferable. Although this is arguably so simple I'm not sure how much is gained by that. |
… division) a16c6d2 Fix error in memory usage calculation (unintended integer division) (practicalswift) Pull request description: Fix bug in memory usage calculation (unintended integer division). Tree-SHA512: 2df1f00c5282581c61e1fd55fef3fabc02161b5a47d8f1795b05d57117245ff3d1ee861dd689eebe0185f28176cea428007e799d5c43a1ce5dc704123439f967
Summary: Backport of Bitcoin Core PR12604 and PR12784 bitcoin/bitcoin#12604 bitcoin/bitcoin#12784 Test Plan: ``` make check ``` Run `bitcoind` with `-debug=leveldb` and check the log file for the `LEVELDB` category and the following pattern: `WriteBatch memory usage: db=..., before=...MiB, after=...MiB` Verify that printed sizes (before and after) make sense. Reviewers: Fabien, O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3948
Summary: Backport of Bitcoin Core PR12604 and PR12784 bitcoin/bitcoin#12604 bitcoin/bitcoin#12784 Test Plan: ``` make check ``` Run `bitcoind` with `-debug=leveldb` and check the log file for the `LEVELDB` category and the following pattern: `WriteBatch memory usage: db=..., before=...MiB, after=...MiB` Verify that printed sizes (before and after) make sense. Reviewers: Fabien, O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3948
Summary: Backport of Bitcoin Core PR12604 and PR12784 bitcoin/bitcoin#12604 bitcoin/bitcoin#12784 Test Plan: ``` make check ``` Run `bitcoind` with `-debug=leveldb` and check the log file for the `LEVELDB` category and the following pattern: `WriteBatch memory usage: db=..., before=...MiB, after=...MiB` Verify that printed sizes (before and after) make sense. Reviewers: Fabien, O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3948
Summary: Backport of Bitcoin Core PR12604 and PR12784 bitcoin/bitcoin#12604 bitcoin/bitcoin#12784 Test Plan: ``` make check ``` Run `bitcoind` with `-debug=leveldb` and check the log file for the `LEVELDB` category and the following pattern: `WriteBatch memory usage: db=..., before=...MiB, after=...MiB` Verify that printed sizes (before and after) make sense. Reviewers: Fabien, O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3948
Summary: Backport of Bitcoin Core PR12604 and PR12784 bitcoin/bitcoin#12604 bitcoin/bitcoin#12784 Test Plan: ``` make check ``` Run `bitcoind` with `-debug=leveldb` and check the log file for the `LEVELDB` category and the following pattern: `WriteBatch memory usage: db=..., before=...MiB, after=...MiB` Verify that printed sizes (before and after) make sense. Reviewers: Fabien, O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3948
…integer division) a16c6d2 Fix error in memory usage calculation (unintended integer division) (practicalswift) Pull request description: Fix bug in memory usage calculation (unintended integer division). Tree-SHA512: 2df1f00c5282581c61e1fd55fef3fabc02161b5a47d8f1795b05d57117245ff3d1ee861dd689eebe0185f28176cea428007e799d5c43a1ce5dc704123439f967
…integer division) a16c6d2 Fix error in memory usage calculation (unintended integer division) (practicalswift) Pull request description: Fix bug in memory usage calculation (unintended integer division). Tree-SHA512: 2df1f00c5282581c61e1fd55fef3fabc02161b5a47d8f1795b05d57117245ff3d1ee861dd689eebe0185f28176cea428007e799d5c43a1ce5dc704123439f967
…integer division) a16c6d2 Fix error in memory usage calculation (unintended integer division) (practicalswift) Pull request description: Fix bug in memory usage calculation (unintended integer division). Tree-SHA512: 2df1f00c5282581c61e1fd55fef3fabc02161b5a47d8f1795b05d57117245ff3d1ee861dd689eebe0185f28176cea428007e799d5c43a1ce5dc704123439f967
Fix bug in memory usage calculation (unintended integer division).