diff options
author | Alexander Fokin <apfokin@gmail.com> | 2022-02-10 16:45:38 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:38 +0300 |
commit | 863a59a65247c24db7cb06789bc5cf79d04da32f (patch) | |
tree | 139dc000c8cd4a40f5659e421b7c75135d080307 /util/system/mlock.h | |
parent | f64e95a9eb9ab03240599eb9581c5a9102426a96 (diff) | |
download | ydb-863a59a65247c24db7cb06789bc5cf79d04da32f.tar.gz |
Restoring authorship annotation for Alexander Fokin <apfokin@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/system/mlock.h')
-rw-r--r-- | util/system/mlock.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/util/system/mlock.h b/util/system/mlock.h index f021c0fe67..06075c3f25 100644 --- a/util/system/mlock.h +++ b/util/system/mlock.h @@ -2,8 +2,8 @@ #include "defaults.h" -#include <util/generic/flags.h> - +#include <util/generic/flags.h> + //on some systems (not win, freebd, linux, but darwin (Mac OS X) //multiple mlock calls on the same address range //require the corresponding number of munlock calls to actually unlock the pages @@ -13,31 +13,31 @@ void LockMemory(const void* addr, size_t len); void UnlockMemory(const void* addr, size_t len); -enum ELockAllMemoryFlag { - /** Lock all pages which are currently mapped into the address space of the process. */ - LockCurrentMemory = 1, - - /** Lock all pages which will become mapped into the address space of the process in the future. */ - LockFutureMemory = 2, +enum ELockAllMemoryFlag { + /** Lock all pages which are currently mapped into the address space of the process. */ + LockCurrentMemory = 1, + + /** Lock all pages which will become mapped into the address space of the process in the future. */ + LockFutureMemory = 2, /** Since Linux 4.4, with LockCurrentMemory or LockFutureMemory or both, lock only pages that are or once they are present in memory. */ LockMemoryOnFault = 4, }; -Y_DECLARE_FLAGS(ELockAllMemoryFlags, ELockAllMemoryFlag) -Y_DECLARE_OPERATORS_FOR_FLAGS(ELockAllMemoryFlags) - -/** - * Performs provided locking operation. - * - * Does nothing on windows. - * - * \param flags Locking operation to perform. - */ -void LockAllMemory(ELockAllMemoryFlags flags); - -/** - * Unlocks whatever was locked with a previous call to `LockAllMemory`. - * - * Does nothing on windows. - */ +Y_DECLARE_FLAGS(ELockAllMemoryFlags, ELockAllMemoryFlag) +Y_DECLARE_OPERATORS_FOR_FLAGS(ELockAllMemoryFlags) + +/** + * Performs provided locking operation. + * + * Does nothing on windows. + * + * \param flags Locking operation to perform. + */ +void LockAllMemory(ELockAllMemoryFlags flags); + +/** + * Unlocks whatever was locked with a previous call to `LockAllMemory`. + * + * Does nothing on windows. + */ void UnlockAllMemory(); |