monotone

monotone Mtn Source Tree

Root/botan/defalloc.h

1/*************************************************
2* Basic Allocators Header File *
3* (C) 1999-2007 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_BASIC_ALLOC_H__
7#define BOTAN_BASIC_ALLOC_H__
8
9#include <botan/mem_pool.h>
10
11namespace Botan {
12
13/*************************************************
14* Malloc Allocator *
15*************************************************/
16class Malloc_Allocator : public Allocator
17 {
18 public:
19 void* allocate(u32bit);
20 void deallocate(void*, u32bit);
21
22 std::string type() const { return "malloc"; }
23 };
24
25/*************************************************
26* Locking Allocator *
27*************************************************/
28class Locking_Allocator : public Pooling_Allocator
29 {
30 public:
31 Locking_Allocator() : Pooling_Allocator(64*1024, true) {}
32 std::string type() const { return "locking"; }
33 private:
34 void* alloc_block(u32bit);
35 void dealloc_block(void*, u32bit);
36 };
37
38}
39
40#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status