diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2013-06-03 15:18:41 +0200 |
---|---|---|
committer | Jonas Schnelli <jonas.schnelli@include7.ch> | 2013-06-03 15:18:41 +0200 |
commit | 39fe9de6b2b255969971beca8fa25a33ad2e5750 (patch) | |
tree | 6686041f6b801d0ea5185b026a480a5be61510e6 /src/allocators.h | |
parent | f679b2900a3a9f863f888cfb0b1a5e593628e37b (diff) | |
parent | fa9e5adddda0bee5adc040b957cf3f1a6a470802 (diff) |
Merge branch 'master' of git://github.com/bitcoin/bitcoin into prefsFix
Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
Conflicts:
bitcoin-qt.pro
Diffstat (limited to 'src/allocators.h')
-rw-r--r-- | src/allocators.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/allocators.h b/src/allocators.h index eb2aed6721..85af8fe376 100644 --- a/src/allocators.h +++ b/src/allocators.h @@ -177,6 +177,19 @@ private: }; // +// 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) { + OPENSSL_cleanse((void*)(&t), sizeof(T)); + LockedPageManager::instance.UnlockRange((void*)(&t), sizeof(T)); +} + +// // Allocator that locks its contents from being paged // out of memory and clears its contents before deletion. // |