Skip to content

Conversation

@practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Mar 26, 2018

Fix bug in memory usage calculation (unintended integer division).

@practicalswift practicalswift changed the title Fix error in memory usage calculation (unintended integer division) Fix bug in memory usage calculation (unintended integer division) Mar 26, 2018
@fanquake fanquake requested a review from eklitzke March 26, 2018 08:17
@promag
Copy link
Contributor

promag commented Mar 27, 2018

ACK 490e8be.

Copy link
Member

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?

Copy link
Contributor Author

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 :-)

@eklitzke
Copy link
Contributor

ACK a16c6d2

I'm really tempted to add formatters for MiB and whatnot as a new format specifier in tinyformat.h, as we have this logic all over the place.

@maflcko
Copy link
Member

maflcko commented Mar 27, 2018

utACK a16c6d2

@practicalswift
Copy link
Contributor Author

@eklitzke Formatters for MiB, etc sounds nice!

@fanquake
Copy link
Member

utACK a16c6d2
I've kickstarted Travis.

@laanwj
Copy link
Member

laanwj commented Mar 29, 2018

I'm really tempted to add formatters for MiB and whatnot as a new format specifier in tinyformat.h, as we have this logic all over the place.

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.

@laanwj laanwj merged commit a16c6d2 into bitcoin:master Mar 29, 2018
laanwj added a commit that referenced this pull request Mar 29, 2018
… 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
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Aug 30, 2019
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
jonspock pushed a commit to jonspock/devault that referenced this pull request Dec 8, 2019
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
jonspock pushed a commit to jonspock/devault that referenced this pull request Dec 8, 2019
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
jonspock pushed a commit to jonspock/devault that referenced this pull request Dec 8, 2019
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
proteanx pushed a commit to devaultcrypto/devault that referenced this pull request Dec 12, 2019
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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 14, 2020
…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
@practicalswift practicalswift deleted the calc-error branch April 10, 2021 19:34
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Jun 24, 2021
…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
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Jan 29, 2022
…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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants