dynpool Class Reference

Inherits memory_block::pool_of_blocks.

Inherited by object_cache< T, TFactory, MaxBytes >::cache_pool.

Inheritance diagram for dynpool:

Inheritance graph
[legend]
Collaboration diagram for dynpool:

Collaboration graph
[legend]
List of all members.

Detailed Description

Allocator of typeless blocks.

Derives from abstract pool_of_blocks. Allocates blocks, using mutexes for thread-safety, from an underlying contiguous chunk of memory. The underlying chunk can be extended but it remains contiguous.

The underlying chunk is managed by the class dynarray, which uses mmap. Each dynpool has its own dynarray, so it gets its own mmapped chunk.

When blocks are released back to the dynpool, they are stuffed into a freelist but they are never given back to the dynarray in any sense.

Each heap of typed objects shares a static(sic) dynpool for that type (well, for that block_pool<T> specialization, of which there *could be* duplicates for a given T, depending on the template structure of the client code);

Definition at line 104 of file block_alloc.h.

Public Types

typedef memory_block::block_of_chips mblock

Public Member Functions

virtual bool validate_pointer (void *ptr)
 Check that ptr falls in the range of the single underlying dynarray (mmapped range). Print a message to stderr and return false if not. Return true if OK.
size_t capacity () const
 Return the max size of the underlying contiguous dynarray. This is not the current size but only the maximum size to which it could possibly grow.
size_t freelist_size () const
 Return the number of items (blocks of chips) on the freelist.

Protected Member Functions

size_t _size () const
mblock_at (size_t i)


The documentation for this class was generated from the following file:
Generated on Mon Jan 2 15:14:04 2012 for Shore Storage Manager by  doxygen 1.4.7