Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

byte_repository Class Reference

byte repository class for allocation memory by fixed chunks More...

#include <byterep.h>

List of all members.

Public Member Functions

char * allocate (size_t len)
 allocates len bytes
void deallocate (char *ptr)
 deallocates (reuse) memory
void reset ()
 release memory back to OS

Private Member Functions

 byte_repository ()
 constructor

Private Attributes

byte_backet< 4, 64 *1024 > _backet4
 page = (16 + 4)*64*64K ~ 64M
byte_backet< 5, 32 *1024 > _backet5
 page = (32 + 4)*64*32K ~ 64M
byte_backet< 6, 16 *1024 > _backet6
 page = (64 + 4)*64*16K ~ 64M
byte_backet< 7, 8 *1024 > _backet7
 page = (128 + 4)*64*8K ~ 64M
byte_backet< 8, 4 *1024 > _backet8
 page = (256 + 4)*64*4K ~ 64M
byte_backet< 9, 2 *1024 > _backet9
 page = (512 + 4)*64*2K ~ 64M
byte_backet< 10, 1 *1024 > _backet10
 page = (1024 + 4)*64*1K ~ 64M
byte_backet< 11, 512 > _backet11
 page = (2048 + 4)*64*512 ~ 64M
byte_backet< 12, 256 > _backet12
 page = (4096 + 4)*64*256 ~ 64M
byte_backet< 13, 128 > _backet13
 page = (8192 + 4)*64*128 ~ 64M

Friends

class byte_repository_factory
 class must be created dynamically due to the size


Detailed Description

byte repository class for allocation memory by fixed chunks

Definition at line 125 of file byterep.h.


Constructor & Destructor Documentation

byte_repository::byte_repository (  )  [inline, private]

constructor

Definition at line 148 of file byterep.h.


Member Function Documentation

char * byte_repository::allocate ( size_t  len  )  [inline]

allocates len bytes

Parameters:
len  size

Definition at line 277 of file byterep.hpp.

References _backet10, _backet11, _backet12, _backet13, _backet4, _backet5, _backet6, _backet7, _backet8, _backet9, and byte_backet< N, M >::allocate().

void byte_repository::deallocate ( char *  ptr  )  [inline]

deallocates (reuse) memory

Parameters:
ptr  memory pointer

Definition at line 338 of file byterep.hpp.

References _backet10, _backet11, _backet12, _backet13, _backet4, _backet5, _backet6, _backet7, _backet8, _backet9, and byte_backet< N, M >::deallocate().

void byte_repository::reset (  )  [inline]

release memory back to OS

Definition at line 384 of file byterep.hpp.

References _backet10, _backet11, _backet12, _backet13, _backet4, _backet5, _backet6, _backet7, _backet8, _backet9, and byte_backet< N, M >::reset().


Friends And Related Function Documentation

friend class byte_repository_factory [friend]

class must be created dynamically due to the size

Definition at line 128 of file byterep.h.


Member Data Documentation

byte_backet< 4, 64*1024 > byte_repository::_backet4 [private]

page = (16 + 4)*64*64K ~ 64M

Definition at line 153 of file byterep.h.

Referenced by allocate(), deallocate(), and reset().

byte_backet< 5, 32*1024 > byte_repository::_backet5 [private]

page = (32 + 4)*64*32K ~ 64M

Definition at line 154 of file byterep.h.

Referenced by allocate(), deallocate(), and reset().

byte_backet< 6, 16*1024 > byte_repository::_backet6 [private]

page = (64 + 4)*64*16K ~ 64M

Definition at line 155 of file byterep.h.

Referenced by allocate(), deallocate(), and reset().

byte_backet< 7, 8*1024 > byte_repository::_backet7 [private]

page = (128 + 4)*64*8K ~ 64M

Definition at line 156 of file byterep.h.

Referenced by allocate(), deallocate(), and reset().

byte_backet< 8, 4*1024 > byte_repository::_backet8 [private]

page = (256 + 4)*64*4K ~ 64M

Definition at line 157 of file byterep.h.

Referenced by allocate(), deallocate(), and reset().

byte_backet< 9, 2*1024 > byte_repository::_backet9 [private]

page = (512 + 4)*64*2K ~ 64M

Definition at line 158 of file byterep.h.

Referenced by allocate(), deallocate(), and reset().

byte_backet< 10, 1*1024 > byte_repository::_backet10 [private]

page = (1024 + 4)*64*1K ~ 64M

Definition at line 159 of file byterep.h.

Referenced by allocate(), deallocate(), and reset().

page = (2048 + 4)*64*512 ~ 64M

Definition at line 160 of file byterep.h.

Referenced by allocate(), deallocate(), and reset().

page = (4096 + 4)*64*256 ~ 64M

Definition at line 161 of file byterep.h.

Referenced by allocate(), deallocate(), and reset().

page = (8192 + 4)*64*128 ~ 64M

Definition at line 162 of file byterep.h.

Referenced by allocate(), deallocate(), and reset().


The documentation for this class was generated from the following files:


© Copyright Terimber 2003-.