diff options
| author | Wladimir J. van der Laan <[email protected]> | 2012-08-22 11:34:32 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2012-08-23 06:55:35 +0200 |
| commit | e95568b78ddead0173339ca98df6cd92131ceb62 (patch) | |
| tree | 3860dc256f0c80a4764ef79bb1fa6fa3ec814392 /src/util.cpp | |
| parent | Merge pull request #1700 from laanwj/2012_08_testsotherfiles (diff) | |
| download | discoin-e95568b78ddead0173339ca98df6cd92131ceb62.tar.xz discoin-e95568b78ddead0173339ca98df6cd92131ceb62.zip | |
Handle locked pages more robustly (Fixes issue #1462)
Memory locks do not stack, that is, pages which have been locked several times by calls to mlock()
will be unlocked by a single call to munlock(). This can result in keying material ending up in swap when
those functions are used naively. In this commit a class "LockedPageManager" is added
that simulates stacking memory locks by keeping a counter per page.
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp index d6d9a368f..461f42d17 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -86,6 +86,8 @@ void locking_callback(int mode, int i, const char* file, int line) } } +LockedPageManager LockedPageManager::instance; + // Init class CInit { |