monotone

monotone Mtn Source Tree

Root/botan/defalloc.h

1/*************************************************
2* Basic Allocators Header File *
3* (C) 1999-2006 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 Pooling_Allocator
17 {
18 public:
19 Malloc_Allocator() : Pooling_Allocator(64*1024, false) {}
20 std::string type() const { return "malloc"; }
21 private:
22 void* alloc_block(u32bit);
23 void dealloc_block(void*, u32bit);
24 };
25
26/*************************************************
27* Locking Allocator *
28*************************************************/
29class Locking_Allocator : public Pooling_Allocator
30 {
31 public:
32 Locking_Allocator() : Pooling_Allocator(64*1024, true) {}
33 std::string type() const { return "locking"; }
34 private:
35 void* alloc_block(u32bit);
36 void dealloc_block(void*, u32bit);
37 };
38
39}
40
41#endif

Archive Download this file

Branches

Tags

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