Add DynamicMemoryUsage() to LevelDB
Summary:
Backport of Bitcoin Core PR12604 and PR12784
https://github.com/bitcoin/bitcoin/pull/12604
https://github.com/bitcoin/bitcoin/pull/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