mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-04 00:12:33 +02:00
Use internal LevelDB test interface to bump LevelDB mmap limit up to 4096 like Bitcoin Core's fork
No-op for embedded, but still done anyway Not applicable to Windows or 32-bit systems
This commit is contained in:
parent
9770213fca
commit
3937e4a03a
@ -46,6 +46,26 @@ bool dbwrapper_SanityCheck()
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
namespace leveldb {
|
||||
class EnvPosixTestHelper {
|
||||
static void SetReadOnlyMMapLimit(int limit);
|
||||
public:
|
||||
static inline void SetReadOnlyMMapLimitForBitcoin(int limit) { SetReadOnlyMMapLimit(limit); }
|
||||
};
|
||||
}
|
||||
|
||||
class BitcoinLevelDBInit {
|
||||
public:
|
||||
BitcoinLevelDBInit() {
|
||||
if (sizeof(void*) >= 8) {
|
||||
leveldb::EnvPosixTestHelper::SetReadOnlyMMapLimitForBitcoin(4096);
|
||||
}
|
||||
}
|
||||
};
|
||||
static BitcoinLevelDBInit g_bitcoin_leveldb_init;
|
||||
#endif
|
||||
|
||||
class CBitcoinLevelDBLogger : public leveldb::Logger {
|
||||
public:
|
||||
// This code is adapted from posix_logger.h, which is why it is using vsprintf.
|
||||
|
Loading…
Reference in New Issue
Block a user