aboutsummaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-09-18 08:40:14 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-10-19 16:17:33 +0200
commitf4d1fc259b5a62580d952c180b1189ccaa6af1bc (patch)
tree38a7786c54effd74d44d04e0394eccc987fca24a /src/support
parent999e4c91c2cd93f4cd8760b3572780c9d568f2f0 (diff)
wallet: Get rid of LockObject and UnlockObject calls in key.h
Replace these with vectors allocated from the secure allocator. This avoids mlock syscall churn on stack pages, as well as makes it possible to get rid of these functions. Please review this commit and the previous one carefully that no `sizeof(vectortype)` remains in the memcpys and memcmps usage (ick!), and `.data()` or `&vec[x]` is used as appropriate instead of &vec.
Diffstat (limited to 'src/support')
-rw-r--r--src/support/pagelocker.h17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/support/pagelocker.h b/src/support/pagelocker.h
index 538bf39453..042144fad5 100644
--- a/src/support/pagelocker.h
+++ b/src/support/pagelocker.h
@@ -157,21 +157,4 @@ private:
static boost::once_flag init_flag;
};
-//
-// Functions for directly locking/unlocking memory objects.
-// Intended for non-dynamically allocated structures.
-//
-template <typename T>
-void LockObject(const T& t)
-{
- LockedPageManager::Instance().LockRange((void*)(&t), sizeof(T));
-}
-
-template <typename T>
-void UnlockObject(const T& t)
-{
- memory_cleanse((void*)(&t), sizeof(T));
- LockedPageManager::Instance().UnlockRange((void*)(&t), sizeof(T));
-}
-
#endif // BITCOIN_SUPPORT_PAGELOCKER_H