Botan  1.10.9
mmap_mem.h
Go to the documentation of this file.
1 /*
2 * Memory Mapping Allocator
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_MMAP_ALLOCATOR_H__
9 #define BOTAN_MMAP_ALLOCATOR_H__
10 
11 #include <botan/internal/mem_pool.h>
12 
13 namespace Botan {
14 
15 /**
16 * Allocator that uses memory maps backed by disk. We zeroize the map
17 * upon deallocation. If swap occurs, the VM will swap to the shared
18 * file backing rather than to a swap device, which means we know where
19 * it is and can zap it later.
20 */
22  {
23  public:
24  /**
25  * @param mutex used for internal locking
26  */
28  std::string type() const { return "mmap"; }
29  private:
30  void* alloc_block(size_t);
31  void dealloc_block(void*, size_t);
32  };
33 
34 }
35 
36 #endif
MemoryMapping_Allocator(Mutex *mutex)
Definition: mmap_mem.h:27
std::string type() const
Definition: mmap_mem.h:28