class representing a page pool
pool of mmapped pages (on systems which support it, on all others, the functionality is emulated with dynamically allocated memory)
in most operating systems there is a limit to how many mappings any one process is allowed to request; for this reason, we mmap a relatively large amount up front, and then carve off little pieces as we need them
Moreover, some systems have too large a physical page size in their MMU for the code to handle (we want offsets and lengths to fit into 16 bits), so we carve such big physical pages into smaller logical Pages if needed. The largest logical page size is currently 16 KiB.
Definition at line 207 of file BidirMMapPipe.cxx.
Public Types | |
typedef PageChunk::MMapVariety | MMapVariety |
convenience typedef | |
Public Member Functions | |
PagePool (unsigned nPagesPerGroup) | |
constructor | |
~PagePool () | |
destructor | |
unsigned | nPagesPerGroup () const |
return number of pages per group (ie. as returned by pop()) | |
Pages | pop () |
pop a free element out of the pool | |
void | zap (Pages &p) |
zap the pool (unmap all but Pages p) | |
Static Public Member Functions | |
static MMapVariety | mmapVariety () |
return variety of mmap supported on the system | |
static unsigned | pagesize () |
return (logical) page size of the system | |
Private Types | |
enum | { minsz = 7 , maxsz = 20 , szincr = 1 } |
typedef BidirMMapPipe_impl::PageChunk | Chunk |
a chunk of memory in the pool | |
typedef std::list< Chunk * > | ChunkList |
list of chunks | |
typedef BidirMMapPipeException | Exception |
convenience typedef | |
Private Member Functions | |
int | nextChunkSz () const |
find size of next chunk to allocate (in a hopefully smart way) | |
void | putOnFreeList (Chunk *chunk) |
release a chunk | |
void | release (Chunk *chunk) |
release a chunk | |
void | updateCurSz (int sz, int incr) |
adjust _cursz to current largest block | |
Private Attributes | |
ChunkList | m_chunks |
list of chunks used by the pool | |
int | m_cursz |
current chunk size | |
ChunkList | m_freelist |
list of chunks used by the pool which are not full | |
unsigned | m_nPgPerGrp |
page group size | |
unsigned | m_szmap [(maxsz - minsz)/szincr] |
chunk size map (histogram of chunk sizes) | |
Friends | |
class | BidirMMapPipe_impl::PageChunk |
a chunk of memory in the pool
Definition at line 218 of file BidirMMapPipe.cxx.
|
private |
list of chunks
Definition at line 220 of file BidirMMapPipe.cxx.
convenience typedef
Definition at line 210 of file BidirMMapPipe.cxx.
convenience typedef
Definition at line 225 of file BidirMMapPipe.cxx.
|
private |
Enumerator | |
---|---|
minsz | minimum chunk size (just below 1 << minsz bytes) |
maxsz | maximum chunk size (just below 1 << maxsz bytes) |
szincr | size class increment (sz = 1 << (minsz + k * szincr)) |
Definition at line 212 of file BidirMMapPipe.cxx.
RooFit::BidirMMapPipe_impl::PagePool::PagePool | ( | unsigned | nPagesPerGroup | ) |
constructor
Definition at line 576 of file BidirMMapPipe.cxx.
RooFit::BidirMMapPipe_impl::PagePool::~PagePool | ( | ) |
destructor
Definition at line 604 of file BidirMMapPipe.cxx.
|
inlinestatic |
return variety of mmap supported on the system
Definition at line 236 of file BidirMMapPipe.cxx.
|
private |
find size of next chunk to allocate (in a hopefully smart way)
Definition at line 684 of file BidirMMapPipe.cxx.
|
inline |
return number of pages per group (ie. as returned by pop())
Definition at line 240 of file BidirMMapPipe.cxx.
|
inlinestatic |
return (logical) page size of the system
Definition at line 234 of file BidirMMapPipe.cxx.
Pages RooFit::BidirMMapPipe_impl::PagePool::pop | ( | ) |
pop a free element out of the pool
Definition at line 628 of file BidirMMapPipe.cxx.
|
private |
release a chunk
Definition at line 666 of file BidirMMapPipe.cxx.
|
private |
release a chunk
Definition at line 647 of file BidirMMapPipe.cxx.
adjust _cursz to current largest block
Definition at line 672 of file BidirMMapPipe.cxx.
void RooFit::BidirMMapPipe_impl::PagePool::zap | ( | Pages & | p | ) |
zap the pool (unmap all but Pages p)
Definition at line 612 of file BidirMMapPipe.cxx.
|
friend |
Definition at line 222 of file BidirMMapPipe.cxx.
|
private |
list of chunks used by the pool
Definition at line 247 of file BidirMMapPipe.cxx.
|
private |
current chunk size
Definition at line 253 of file BidirMMapPipe.cxx.
|
private |
list of chunks used by the pool which are not full
Definition at line 249 of file BidirMMapPipe.cxx.
|
private |
page group size
Definition at line 255 of file BidirMMapPipe.cxx.
chunk size map (histogram of chunk sizes)
Definition at line 251 of file BidirMMapPipe.cxx.