aboutsummaryrefslogtreecommitdiff
path: root/src/allocators.h
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2013-05-01 06:52:05 +0200
committerPieter Wuille <[email protected]>2013-05-30 05:20:21 +0200
commitdfa23b94c24aae6466152fccbe896ba5dc0e97b4 (patch)
treea1f7f856577b2223bae9351c960b595b4032ce7a /src/allocators.h
parentMake CPubKey statically allocated (diff)
downloaddiscoin-dfa23b94c24aae6466152fccbe896ba5dc0e97b4.tar.xz
discoin-dfa23b94c24aae6466152fccbe896ba5dc0e97b4.zip
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 eb2aed672..b4490ce27 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.