aboutsummaryrefslogtreecommitdiff
path: root/src/support/lockedpool.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/support/lockedpool.h')
-rw-r--r--src/support/lockedpool.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/support/lockedpool.h b/src/support/lockedpool.h
index 03e4e371a3..81e0df513a 100644
--- a/src/support/lockedpool.h
+++ b/src/support/lockedpool.h
@@ -5,11 +5,11 @@
#ifndef BITCOIN_SUPPORT_LOCKEDPOOL_H
#define BITCOIN_SUPPORT_LOCKEDPOOL_H
-#include <stdint.h>
+#include <cstddef>
#include <list>
#include <map>
-#include <mutex>
#include <memory>
+#include <mutex>
#include <unordered_map>
/**
@@ -89,23 +89,23 @@ public:
*/
bool addressInArena(void *ptr) const { return ptr >= base && ptr < end; }
private:
- typedef std::multimap<size_t, char*> SizeToChunkSortedMap;
+ typedef std::multimap<size_t, void*> SizeToChunkSortedMap;
/** Map to enable O(log(n)) best-fit allocation, as it's sorted by size */
SizeToChunkSortedMap size_to_free_chunk;
- typedef std::unordered_map<char*, SizeToChunkSortedMap::const_iterator> ChunkToSizeMap;
+ typedef std::unordered_map<void*, SizeToChunkSortedMap::const_iterator> ChunkToSizeMap;
/** Map from begin of free chunk to its node in size_to_free_chunk */
ChunkToSizeMap chunks_free;
/** Map from end of free chunk to its node in size_to_free_chunk */
ChunkToSizeMap chunks_free_end;
/** Map from begin of used chunk to its size */
- std::unordered_map<char*, size_t> chunks_used;
+ std::unordered_map<void*, size_t> chunks_used;
/** Base address of arena */
- char* base;
+ void* base;
/** End address of arena */
- char* end;
+ void* end;
/** Minimum chunk alignment */
size_t alignment;
};
@@ -198,7 +198,7 @@ private:
std::list<LockedPageArena> arenas;
LockingFailed_Callback lf_cb;
- size_t cumulative_bytes_locked;
+ size_t cumulative_bytes_locked{0};
/** Mutex protects access to this pool's data structures, including arenas.
*/
mutable std::mutex mutex;