monotone

monotone Mtn Source Tree

Root/botan/defalloc.h

1/*************************************************
2* Basic Allocators Header File *
3* (C) 1999-2005 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 private:
19 void* alloc_block(u32bit) const;
20 void dealloc_block(void*, u32bit) const;
21 };
22
23/*************************************************
24* Locking Allocator *
25*************************************************/
26class Locking_Allocator : public Pooling_Allocator
27 {
28 private:
29 void* alloc_block(u32bit) const;
30 void dealloc_block(void*, u32bit) const;
31 u32bit prealloc_bytes() const { return 256*1024; }
32 u32bit keep_free() const { return 256*1024; }
33 };
34
35}
36
37#endif

Archive Download this file

Branches

Tags

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