From dfa23b94c24aae6466152fccbe896ba5dc0e97b4 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 1 May 2013 06:52:05 +0200 Subject: CSecret/CKey -> CKey/CPubKey split/refactor --- src/allocators.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/allocators.h') 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 void LockObject(const T &t) { + LockedPageManager::instance.LockRange((void*)(&t), sizeof(T)); +} + +template 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. -- cgit v1.2.3 From 896185d7ed3fa23415424c608f0897d6139640f4 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 4 May 2013 16:10:09 +0200 Subject: Make signature cache store CPubKeys --- src/allocators.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/allocators.h') diff --git a/src/allocators.h b/src/allocators.h index b4490ce27..85af8fe37 100644 --- a/src/allocators.h +++ b/src/allocators.h @@ -176,6 +176,10 @@ private: {} }; +// +// Functions for directly locking/unlocking memory objects. +// Intended for non-dynamically allocated structures. +// template void LockObject(const T &t) { LockedPageManager::instance.LockRange((void*)(&t), sizeof(T)); } -- cgit v1.2.3