aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/mlock.h
blob: 66ced9e63bf9bfabce130893a9a32d9b29d64376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* Memory Locking Functions
* (C) 1999-2007 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/

#ifndef BOTAN_MLOCK_H__
#define BOTAN_MLOCK_H__

#include <botan/types.h>

namespace Botan {

/**
* Lock memory into RAM if possible
* @param addr the start of the memory block
* @param length the length of the memory block in bytes
* @returns true if successful, false otherwise
*/
bool lock_mem(void* addr, u32bit length);

/**
* Unlock memory locked with lock_mem()
* @param addr the start of the memory block
* @param length the length of the memory block in bytes
*/
void unlock_mem(void* addr, u32bit length);

}

#endif