Skip to content

Commit 7793f18

Browse files
committed
Merge #2276: [Core] Locked memory manager
1c04a35 [Trivial] Use C++11 nulltpr instead of NULL macro in allocators files (random-zebra) 68a3f8f bench: Add benchmark for lockedpool allocation/deallocation (Wladimir J. van der Laan) cd34088 rpc: Add `getmemoryinfo` call (Wladimir J. van der Laan) 2d2e331 support: Add LockedPool (Wladimir J. van der Laan) 6ca6470 allocators: split allocators and pagelocker (random-zebra) Pull request description: First commit adapts btc d7d187e. Then backport the last 3 commits of bitcoin#8753, which were left out in #1488. ACKs for top commit: Fuzzbawls: ACK 1c04a35 furszy: ACK 1c04a35 . Tree-SHA512: 9ee1100df3648a73e1fcd9b98f7fb793d3eb342ad239d3d4f9b2dd32dc0bacfdb29825e84e4e2ba4e621aedb0a62ae66dfba4d76a435b77dd5e2af1a01541890
2 parents 21c4555 + 1c04a35 commit 7793f18

20 files changed

+1042
-423
lines changed

CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ target_include_directories(ZEROCOIN_A PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
374374
)
375375

376376
set(COMMON_SOURCES
377-
./src/allocators.cpp
378377
./src/base58.cpp
379378
./src/bip38.cpp
380379
./src/consensus/params.cpp
@@ -421,7 +420,6 @@ target_include_directories(COMMON_A PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
421420
)
422421

423422
set(UTIL_SOURCES
424-
./src/allocators.cpp
425423
./src/compat/strnlen.cpp
426424
./src/compat/glibc_sanity.cpp
427425
./src/compat/glibcxx_sanity.cpp
@@ -441,6 +439,7 @@ set(UTIL_SOURCES
441439
./src/utilstrencodings.cpp
442440
./src/utilmoneystr.cpp
443441
./src/utiltime.cpp
442+
./src/support/lockedpool.cpp
444443
./src/support/cleanse.cpp
445444
)
446445
add_library(UTIL_A STATIC ${BitcoinHeaders} ${UTIL_SOURCES})

src/Makefile.am

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ BITCOIN_CORE_H = \
148148
activemasternode.h \
149149
addrdb.h \
150150
addrman.h \
151-
allocators.h \
152151
arith_uint256.h \
153152
amount.h \
154153
base58.h \
@@ -260,7 +259,10 @@ BITCOIN_CORE_H = \
260259
stakeinput.h \
261260
script/ismine.h \
262261
streams.h \
262+
support/allocators/secure.h \
263+
support/allocators/zeroafterfree.h \
263264
support/cleanse.h \
265+
support/lockedpool.h \
264266
sync.h \
265267
threadsafety.h \
266268
threadinterrupt.h \
@@ -485,7 +487,6 @@ endif
485487
libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
486488
libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
487489
libbitcoin_common_a_SOURCES = \
488-
allocators.cpp \
489490
base58.cpp \
490491
bip38.cpp \
491492
chainparams.cpp \
@@ -526,7 +527,6 @@ libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
526527
libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
527528
libbitcoin_util_a_SOURCES = \
528529
arith_uint256.cpp \
529-
allocators.cpp \
530530
chainparamsbase.cpp \
531531
clientversion.cpp \
532532
compat/glibc_sanity.cpp \
@@ -538,6 +538,7 @@ libbitcoin_util_a_SOURCES = \
538538
random.cpp \
539539
rpc/protocol.cpp \
540540
support/cleanse.cpp \
541+
support/lockedpool.cpp \
541542
sync.cpp \
542543
threadinterrupt.cpp \
543544
uint256.cpp \
@@ -670,7 +671,6 @@ if BUILD_BITCOIN_LIBS
670671
include_HEADERS = script/bitcoinconsensus.h
671672
libbitcoinconsensus_la_SOURCES = \
672673
arith_uint256.cpp \
673-
allocators.cpp \
674674
primitives/transaction.cpp \
675675
crypto/hmac_sha512.cpp \
676676
crypto/scrypt.cpp \

src/Makefile.bench.include

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ bench_bench_pivx_SOURCES = \
1111
bench/bench_pivx.cpp \
1212
bench/bench.cpp \
1313
bench/bench.h \
14-
bench/checkblock.cpp \
1514
bench/Examples.cpp \
1615
bench/base58.cpp \
16+
bench/checkblock.cpp \
1717
bench/checkqueue.cpp \
1818
bench/crypto_hash.cpp \
19+
bench/lockedpool.cpp \
1920
bench/perf.cpp \
2021
bench/perf.h \
2122
bench/prevector.cpp

src/allocators.cpp

-66
This file was deleted.

0 commit comments

Comments
 (0)