aboutsummaryrefslogtreecommitdiff
path: root/src/allocators.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-05-01 06:52:05 +0200
committerPieter Wuille <sipa@ulyssis.org>2013-05-30 05:20:21 +0200
commitdfa23b94c24aae6466152fccbe896ba5dc0e97b4 (patch)
treea1f7f856577b2223bae9351c960b595b4032ce7a /src/allocators.h
parent5d891489ab7828ad8db15e85bb63e2f13f021a6a (diff)
CSecret/CKey -> CKey/CPubKey split/refactor
Diffstat (limited to 'src/allocators.h')
-rw-r--r--src/allocators.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/allocators.h b/src/allocators.h
index eb2aed6721..b4490ce277 100644
--- a/src/allocators.h
+++ b/src/allocators.h
@@ -176,6 +176,15 @@ private:
{}
};
+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.