aboutsummaryrefslogtreecommitdiff
path: root/src/allocators.h
diff options
context:
space:
mode:
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.