Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooFit::BidirMMapPipe_impl::PagePool Class Reference

class representing a page pool

Author
Manuel Schiller manue.nosp@m.l.sc.nosp@m.hille.nosp@m.r@ni.nosp@m.khef..nosp@m.nl
Date
2013-07-24

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
 

Member Typedef Documentation

◆ Chunk

a chunk of memory in the pool

Definition at line 218 of file BidirMMapPipe.cxx.

◆ ChunkList

list of chunks

Definition at line 220 of file BidirMMapPipe.cxx.

◆ Exception

convenience typedef

Definition at line 210 of file BidirMMapPipe.cxx.

◆ MMapVariety

convenience typedef

Definition at line 225 of file BidirMMapPipe.cxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
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.

Constructor & Destructor Documentation

◆ PagePool()

RooFit::BidirMMapPipe_impl::PagePool::PagePool ( unsigned  nPagesPerGroup)

constructor

Definition at line 576 of file BidirMMapPipe.cxx.

◆ ~PagePool()

RooFit::BidirMMapPipe_impl::PagePool::~PagePool ( )

destructor

Definition at line 604 of file BidirMMapPipe.cxx.

Member Function Documentation

◆ mmapVariety()

static MMapVariety RooFit::BidirMMapPipe_impl::PagePool::mmapVariety ( )
inlinestatic

return variety of mmap supported on the system

Definition at line 236 of file BidirMMapPipe.cxx.

◆ nextChunkSz()

int RooFit::BidirMMapPipe_impl::PagePool::nextChunkSz ( ) const
private

find size of next chunk to allocate (in a hopefully smart way)

Definition at line 684 of file BidirMMapPipe.cxx.

◆ nPagesPerGroup()

unsigned RooFit::BidirMMapPipe_impl::PagePool::nPagesPerGroup ( ) const
inline

return number of pages per group (ie. as returned by pop())

Definition at line 240 of file BidirMMapPipe.cxx.

◆ pagesize()

static unsigned RooFit::BidirMMapPipe_impl::PagePool::pagesize ( )
inlinestatic

return (logical) page size of the system

Definition at line 234 of file BidirMMapPipe.cxx.

◆ pop()

Pages RooFit::BidirMMapPipe_impl::PagePool::pop ( )

pop a free element out of the pool

Definition at line 628 of file BidirMMapPipe.cxx.

◆ putOnFreeList()

void RooFit::BidirMMapPipe_impl::PagePool::putOnFreeList ( Chunk chunk)
private

release a chunk

Definition at line 666 of file BidirMMapPipe.cxx.

◆ release()

void RooFit::BidirMMapPipe_impl::PagePool::release ( Chunk chunk)
private

release a chunk

Definition at line 647 of file BidirMMapPipe.cxx.

◆ updateCurSz()

void RooFit::BidirMMapPipe_impl::PagePool::updateCurSz ( int  sz,
int  incr 
)
private

adjust _cursz to current largest block

Definition at line 672 of file BidirMMapPipe.cxx.

◆ zap()

void RooFit::BidirMMapPipe_impl::PagePool::zap ( Pages p)

zap the pool (unmap all but Pages p)

Definition at line 612 of file BidirMMapPipe.cxx.

Friends And Related Symbol Documentation

◆ BidirMMapPipe_impl::PageChunk

friend class BidirMMapPipe_impl::PageChunk
friend

Definition at line 222 of file BidirMMapPipe.cxx.

Member Data Documentation

◆ m_chunks

ChunkList RooFit::BidirMMapPipe_impl::PagePool::m_chunks
private

list of chunks used by the pool

Definition at line 247 of file BidirMMapPipe.cxx.

◆ m_cursz

int RooFit::BidirMMapPipe_impl::PagePool::m_cursz
private

current chunk size

Definition at line 253 of file BidirMMapPipe.cxx.

◆ m_freelist

ChunkList RooFit::BidirMMapPipe_impl::PagePool::m_freelist
private

list of chunks used by the pool which are not full

Definition at line 249 of file BidirMMapPipe.cxx.

◆ m_nPgPerGrp

unsigned RooFit::BidirMMapPipe_impl::PagePool::m_nPgPerGrp
private

page group size

Definition at line 255 of file BidirMMapPipe.cxx.

◆ m_szmap

unsigned RooFit::BidirMMapPipe_impl::PagePool::m_szmap[(maxsz - minsz)/szincr]
private

chunk size map (histogram of chunk sizes)

Definition at line 251 of file BidirMMapPipe.cxx.

  • roofit/roofitcore/src/BidirMMapPipe.cxx