Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

VMemPool Class Reference

#include <VMemPool.H>

Inheritance diagram for VMemPool:

VMemPoolBlockSP List of all members.

Public Types

typedef void(* markCallback )(void *closure, typeCode type)
typedef bool(* sweepCallback )(void *closure, typeCode type, void *addr, Bit32 &size)
typedef void(* rebuildCallback )(void *closure, typeCode type, void *addr, Bit32 &size)
enum  typeCode {
  freeByte = 0, freeBlock, vDirChangeable, vForward,
  vDirEvaluator, vDirImmutable, vAttrib, vDirAppendable,
  maxTypeCodes = 0x10, unspecified
}

Static Public Member Functions

static void * allocate (typeCode type, Bit32 size) throw ()
static void free (void *addr, Bit32 size, typeCode type=unspecified) throw ()
static typeCode type (void *addr) throw ()
static Bit32 shortenPointer (const void *pointer) throw ()
static void * lengthenPointer (Bit32 spointer) throw ()
static void gc (ShortIdsFile keepDerivedSid) throw ()
static void registerCallbacks (typeCode type, markCallback markcb, void *markcl, sweepCallback sweepcb, void *sweepcl, rebuildCallback rebuildcb, void *rebuildcl) throw ()
static void writeCheckpoint (std::fstream &ckpt) throw ()
static void readCheckpoint (std::fstream &ckpt, bool readVolatile) throw ()

Static Public Attributes

static int alignmentMask

Static Protected Member Functions

static void init ()

Static Protected Attributes

static Bit8 * base

Static Private Member Functions

static void rebuildDirShortIdTable () throw ()
static void grow (Bit32 growBy) throw ()

Static Private Attributes

static Bit32 totalSize
static Bit32 minGrowBy

Friends

void VMemPool_init ()

Member Typedef Documentation

typedef void(* VMemPool::markCallback)(void *closure, typeCode type)
 

Definition at line 116 of file VMemPool.H.

typedef void(* VMemPool::rebuildCallback)(void *closure, typeCode type, void *addr, Bit32 &size)
 

Definition at line 119 of file VMemPool.H.

typedef bool(* VMemPool::sweepCallback)(void *closure, typeCode type, void *addr, Bit32 &size)
 

Definition at line 117 of file VMemPool.H.


Member Enumeration Documentation

enum VMemPool::typeCode
 

Enumeration values:
freeByte 
freeBlock 
vDirChangeable 
vForward 
vDirEvaluator 
vDirImmutable 
vAttrib 
vDirAppendable 
maxTypeCodes 
unspecified 

Definition at line 53 of file VMemPool.H.


Member Function Documentation

void * VMemPool::allocate (  typeCode  type,
Bit32  size
)  throw () [static]
 

Definition at line 184 of file VMemPool.C.

References alignmentMask, FREEBK_MINSIZE, freeBlock, freeByte, VMemPoolBlockSP::length(), lengthenPointer(), Basics::mutex::lock(), VMemPoolBlockSP::next(), VMemPoolBlockSP::setLength(), VMemPoolBlockSP::setNext(), VMemPoolBlockSP::setType(), SNULL, VMemPoolBlockSP::sp, Basics::mutex::unlock(), and VMemPool_init().

Referenced by VDirChangeable::appendEntry(), VForward::create(), VestaAttribsRep::create(), VDirChangeable::VDirChangeable(), and VDirEvaluator::VDirEvaluator().

void VMemPool::free (  void *  addr,
Bit32  size,
typeCode  type = unspecified
)  throw () [static]
 

Definition at line 270 of file VMemPool.C.

References alignmentMask, FREEBK_MINSIZE, freeBlock, freeByte, Basics::mutex::lock(), VMemPoolBlockSP::next(), VMemPoolBlockSP::setLength(), VMemPoolBlockSP::setNext(), VMemPoolBlockSP::setType(), shortenPointer(), SNULL, VMemPoolBlockSP::sp, VMemPoolBlockSP::type(), and Basics::mutex::unlock().

Referenced by VDirChangeable::copyMutableToImmutable(), VDirEvaluator::freeTree(), VDirChangeable::freeTree(), and VestaAttribs::writeAttrib().

static void VMemPool::gc (  ShortIdsFile  keepDerivedSid  )  throw () [static]
 

Referenced by SourceWeed().

void VMemPool::grow (  Bit32  growBy  )  throw () [static, private]
 

Definition at line 639 of file VMemPool.C.

References DBG_ALWAYS, Repos::dprintf(), VMemPoolBlockSP::sp, and totalSize.

void VMemPool::init (   )  [static, protected]
 

Definition at line 551 of file VMemPool.C.

References base, Text::cchars(), DBG_ALWAYS, Repos::dprintf(), freeByte, VestaConfig::get(), Basics::mutex::lock(), minGrowBy, VestaConfig::failure::msg, shortenPointer(), SNULL, VMemPoolBlockSP::sp, totalSize, and Basics::mutex::unlock().

Referenced by VMemPool_init().

static void* VMemPool::lengthenPointer (  Bit32  spointer  )  throw () [inline, static]
 

Definition at line 96 of file VMemPool.H.

References base.

Referenced by allocate(), VestaAttribsRep::checkpoint(), VDirVolatileRoot::checkpoint(), VDirChangeable::checkpoint(), CheckpointAllDirShortIds(), VDirChangeable::collapse(), VestaAttribs::copyAttribs(), VDirChangeable::copyMutableToImmutable(), VDirVolatileRoot::deleteIndex(), VDirChangeable::fillCaches(), VDirChangeable::findArc(), VDirChangeable::findRawIndex(), VDirChangeable::freeTree(), GardenerThread(), FPShortIdTable::Get(), VestaAttribs::getAttrib(), VestaAttribs::getAttribConst(), VestaAttribs::getAttribHistory(), VDirChangeable::list(), VestaAttribs::listAttribs(), VDirVolatileRoot::lookup(), VDirVolatileRoot::lookupIndex(), VDirChangeable::lookupIndex(), VDirVolatileRoot::lookupIndexAndLock(), VestaAttribsRep::mark(), VDirVolatileRoot::mark(), VDirChangeable::mark(), VestaAttribsRep::markCallback(), VDirChangeable::measureDirectory(), readCheckpoint(), VDirChangeable::reallyDelete(), FPShortIdTable::Resize(), FPShortIdTable::Set(), VDCLookupResult(), VestaAttribs::wouldWriteAttrib(), VestaAttribs::writeAttrib(), and writeCheckpoint().

void VMemPool::readCheckpoint (  std::fstream &  ckpt,
bool  readVolatile
)  throw () [static]
 

Definition at line 764 of file VMemPool.C.

References alignmentMask, VestaAttribs::attribs, base, DBG_ALWAYS, Repos::dprintf(), lengthenPointer(), Basics::mutex::lock(), VestaSource::mutableRoot(), ok(), VestaSource::rep, VestaSource::repositoryRoot(), VestaSource::resync(), SNULL, VMemPoolBlockSP::sp, Basics::mutex::unlock(), and VestaSource::volatileRoot().

Referenced by CheckpointServer(), and Recover().

void VMemPool::rebuildDirShortIdTable (   )  throw () [static, private]
 

Definition at line 481 of file VMemPool.C.

References base, DeleteAllDirShortIds(), DeleteAllFPShortId(), rebuildcl, shortenPointer(), VMemPoolBlockSP::sp, and VMemPoolBlockSP::type().

void VMemPool::registerCallbacks (  typeCode  type,
markCallback  markcb,
void *  markcl,
sweepCallback  sweepcb,
void *  sweepcl,
rebuildCallback  rebuildcb,
void *  rebuildcl
)  throw () [static]
 

Definition at line 505 of file VMemPool.C.

References Basics::mutex::lock(), markcb, markcl, rebuildcb, rebuildcl, sweepcb, Basics::mutex::unlock(), and VMemPool_init().

Referenced by InitVRWeed().

static Bit32 VMemPool::shortenPointer (  const void *  pointer  )  throw () [inline, static]
 

Definition at line 90 of file VMemPool.H.

References base.

Referenced by VDirChangeable::appendEntry(), VDirChangeable::collapse(), VDirChangeable::collapseBase(), VestaAttribs::copyAttribs(), VDirChangeable::copyIndexToMutable(), VDirChangeable::copyMutableToImmutable(), VForward::create(), VDirVolatileRoot::createVolatileDirectory(), free(), init(), VDirChangeable::insertAppendableDirectory(), VDirChangeable::insertImmutableDirectory(), VDirChangeable::insertMutableDirectory(), VDirChangeable::makeIndexMutable(), VDirChangeable::rebuildCallback(), rebuildDirShortIdTable(), VDirChangeable::renameTo(), FPShortIdTable::Set(), type(), and VestaAttribs::writeAttrib().

VMemPool::typeCode VMemPool::type (  void *  addr  )  throw () [static]
 

Definition at line 322 of file VMemPool.C.

References shortenPointer(), VMemPoolBlockSP::sp, and VMemPoolBlockSP::type().

Referenced by VDirChangeable::appendEntry(), VestaAttribsRep::checkpoint(), VDirEvaluator::checkpoint(), VDirChangeable::checkpoint(), VestaAttribs::copyAttribs(), VDirEvaluator::freeTree(), VestaAttribs::getAttrib(), VestaAttribs::getAttribConst(), VestaAttribs::getAttribHistory(), VDirEvaluator::list(), VestaAttribs::listAttribs(), VDirEvaluator::lookup(), VDirEvaluator::lookupIndex(), VestaAttribsRep::mark(), VDirEvaluator::mark(), VDirChangeable::mark(), VDirEvaluator::VDirEvaluator(), VestaAttribs::wouldWriteAttrib(), and VestaAttribs::writeAttrib().

void VMemPool::writeCheckpoint (  std::fstream &  ckpt  )  throw () [static]
 

Definition at line 673 of file VMemPool.C.

References VestaAttribs::attribs, VestaAttribsRep::checkpoint(), VestaSource::checkpoint(), CheckpointAllDirShortIds(), VestaAttribs::firstAttrib(), lengthenPointer(), Basics::mutex::lock(), VestaSource::mutableRoot(), VestaSource::rep, VestaSource::repositoryRoot(), Basics::mutex::unlock(), and VestaSource::volatileRoot().

Referenced by CheckpointServer().


Friends And Related Function Documentation

void VMemPool_init (   )  [friend]
 

Definition at line 177 of file VMemPool.C.


Member Data Documentation

int VMemPool::alignmentMask [static]
 

Definition at line 153 of file VMemPool.C.

Referenced by allocate(), VForward::checkpoint(), VestaAttribsRep::checkpoint(), VDirEvaluator::checkpoint(), VDirChangeable::checkpoint(), free(), and readCheckpoint().

Bit8 * VMemPool::base [static, protected]
 

Definition at line 130 of file VMemPool.C.

Referenced by init(), VMemPoolBlockSP::length(), lengthenPointer(), VMemPoolBlockSP::next(), readCheckpoint(), rebuildDirShortIdTable(), VMemPoolBlockSP::setLength(), VMemPoolBlockSP::setNext(), VMemPoolBlockSP::setType(), shortenPointer(), and VMemPoolBlockSP::type().

Bit32 VMemPool::minGrowBy [static, private]
 

Definition at line 132 of file VMemPool.C.

Referenced by init().

Bit32 VMemPool::totalSize [static, private]
 

Definition at line 131 of file VMemPool.C.

Referenced by init().


The documentation for this class was generated from the following files:
Generated on Mon May 8 00:49:17 2006 for Vesta by  doxygen 1.4.2