Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends
morkBeadProbeMap Class Reference

#include <morkBead.h>

Inheritance diagram for morkBeadProbeMap:
Inheritance graph
[legend]
Collaboration diagram for morkBeadProbeMap:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void CloseMorkNode (morkEnv *ev)
virtual ~morkBeadProbeMap ()
 morkBeadProbeMap (morkEnv *ev, const morkUsage &inUsage, nsIMdbHeap *ioHeap, nsIMdbHeap *ioSlotHeap)
void CloseBeadProbeMap (morkEnv *ev)
mork_bool IsBeadProbeMap () const
virtual mork_test MapTest (morkEnv *ev, const void *inMapKey, const void *inAppKey) const
virtual mork_u4 MapHash (morkEnv *ev, const void *inAppKey) const
virtual mork_u4 ProbeMapHashMapKey (morkEnv *ev, const void *inMapKey) const
mork_bool AddBead (morkEnv *ev, morkBead *ioBead)
morkBeadGetBead (morkEnv *ev, mork_color inColor)
mork_num CutAllBeads (morkEnv *ev)
mork_count MapSeed () const
mork_count MapSlots () const
mork_fill MapFill () const
mork_size MapKeySize () const
mork_size MapValSize () const
mork_bool MapKeyIsIP () const
mork_bool MapValIsIP () const
mork_bool need_lazy_init () const
mork_bool GoodProbeMap () const
void ProbeMapBadTagError (morkEnv *ev) const
void WrapWithNoVoidSlotError (morkEnv *ev) const
void GrowFailsMaxFillError (morkEnv *ev) const
void MapKeyIsNotIPError (morkEnv *ev) const
void MapValIsNotIPError (morkEnv *ev) const
void MapNilKeysError (morkEnv *ev)
void MapZeroKeySizeError (morkEnv *ev)
void MapSeedOutOfSyncError (morkEnv *ev)
void MapFillUnderflowWarning (morkEnv *ev)
virtual mork_bool MapAtPut (morkEnv *ev, const void *inAppKey, const void *inAppVal, void *outAppKey, void *outAppVal)
virtual mork_bool MapAt (morkEnv *ev, const void *inAppKey, void *outAppKey, void *outAppVal)
virtual mork_num MapCutAll (morkEnv *ev)
virtual mork_bool ProbeMapIsKeyNil (morkEnv *ev, void *ioMapKey)
virtual void ProbeMapClearKey (morkEnv *ev, void *ioMapKey, mork_count inKeyCount)
virtual void ProbeMapPushIn (morkEnv *ev, const void *inAppKey, const void *inAppVal, void *outMapKey, void *outMapVal)
virtual void ProbeMapPullOut (morkEnv *ev, const void *inMapKey, const void *inMapVal, void *outAppKey, void *outAppVal) const
void CloseProbeMap (morkEnv *ev)
mork_bool IsProbeMap () const
void SetFrozen ()
void SetMutable ()
void SetAsleep ()
mork_bool IsFrozen () const
mork_bool IsMutable () const
mork_bool IsAsleep () const
void SetNodeClean ()
void SetNodeDirty ()
mork_bool IsNodeClean () const
mork_bool IsNodeDirty () const
void ZapOld (morkEnv *ev, nsIMdbHeap *ioHeap)
voidoperator new (size_t inSize, nsIMdbHeap &ioHeap, morkEnv *ev) CPP_THROW_NEW
void CloseNode (morkEnv *ev)
mdb_err CloseMdbObject (morkEnv *ev)
NS_IMETHOD CloseMdbObject (nsIMdbEnv *ev)
mork_bool IsNode () const
void RefsUnderUsesWarning (morkEnv *ev) const
void NonNodeError (morkEnv *ev) const
void NilHeapError (morkEnv *ev) const
void NonOpenNodeError (morkEnv *ev) const
void NonMutableNodeError (morkEnv *ev) const
void RefsOverflowWarning (morkEnv *ev) const
void UsesOverflowWarning (morkEnv *ev) const
void RefsUnderflowWarning (morkEnv *ev) const
void UsesUnderflowWarning (morkEnv *ev) const
mork_bool GoodRefs () const
mork_bool BadRefs () const
mork_uses StrongRefsOnly () const
mork_refs WeakRefsOnly () const
virtual mork_refs AddStrongRef (morkEnv *ev)
virtual mork_refs CutStrongRef (morkEnv *ev)
mork_refs AddWeakRef (morkEnv *ev)
mork_refs CutWeakRef (morkEnv *ev)
const char * GetNodeAccessAsString () const
const char * GetNodeUsageAsString () const
mork_usage NodeUsage () const
mork_bool IsHeapNode () const
mork_bool IsOpenNode () const
mork_bool IsShutNode () const
mork_bool IsDeadNode () const
mork_bool IsClosingNode () const
mork_bool IsOpenOrClosingNode () const
mork_bool HasNodeAccess () const
void MarkShut ()
void MarkClosing ()
void MarkDead ()

Static Public Member Functions

static void ProbeMapCutError (morkEnv *ev)
static void SlotWeakMap (morkMap *me, morkEnv *ev, morkMap **ioSlot)
static void SlotStrongMap (morkMap *me, morkEnv *ev, morkMap **ioSlot)
static voidMakeNew (size_t inSize, nsIMdbHeap &ioHeap, morkEnv *ev)
static void SlotWeakNode (morkNode *me, morkEnv *ev, morkNode **ioSlot)
static void SlotStrongNode (morkNode *me, morkEnv *ev, morkNode **ioSlot)

Public Attributes

nsIMdbHeapmNode_Heap
mork_base mNode_Base
mork_derived mNode_Derived
mork_access mNode_Access
mork_usage mNode_Usage
mork_able mNode_Mutable
mork_load mNode_Load
mork_uses mNode_Uses
mork_refs mNode_Refs

Protected Member Functions

voidclear_alloc (morkEnv *ev, mork_size inSize)
mork_u1map_new_vals (morkEnv *ev, mork_num inSlots)
mork_u1map_new_keys (morkEnv *ev, mork_num inSlots)
void clear_probe_map (morkEnv *ev, nsIMdbHeap *ioMapHeap)
void init_probe_map (morkEnv *ev, mork_size inSlots)
void probe_map_lazy_init (morkEnv *ev)
mork_bool new_slots (morkEnv *ev, morkMapScratch *old, mork_num inSlots)
mork_test find_key_pos (morkEnv *ev, const void *inAppKey, mork_u4 inHash, mork_pos *outPos) const
void put_probe_kv (morkEnv *ev, const void *inAppKey, const void *inAppVal, mork_pos inPos)
void get_probe_kv (morkEnv *ev, void *outAppKey, void *outAppVal, mork_pos inPos) const
mork_bool grow_probe_map (morkEnv *ev)
void rehash_old_map (morkEnv *ev, morkMapScratch *ioScratch)
void revert_map (morkEnv *ev, morkMapScratch *ioScratch)

Protected Attributes

nsIMdbHeapsMap_Heap
mork_u1sMap_Keys
mork_u1sMap_Vals
mork_count sMap_Seed
mork_count sMap_Slots
mork_fill sMap_Fill
mork_size sMap_KeySize
mork_size sMap_ValSize
mork_bool sMap_KeyIsIP
mork_bool sMap_ValIsIP
mork_u1 sMap_Pad [2]
mork_fill sProbeMap_MaxFill
mork_u1 sProbeMap_LazyClearOnAdd
mork_bool sProbeMap_ZeroIsClearKey
mork_u1 sProbeMap_Pad [2]
mork_u4 sProbeMap_Tag

Friends

class morkProbeMapIter
class morkHandleFrame

Detailed Description

Definition at line 200 of file morkBead.h.


Constructor & Destructor Documentation

Definition at line 329 of file morkBead.cpp.

{
  MORK_ASSERT(this->IsShutNode());
}

Here is the call graph for this function:

morkBeadProbeMap::morkBeadProbeMap ( morkEnv ev,
const morkUsage inUsage,
nsIMdbHeap ioHeap,
nsIMdbHeap ioSlotHeap 
)

Definition at line 336 of file morkBead.cpp.

: morkProbeMap(ev, inUsage, ioHeap,
  /*inKeySize*/ sizeof(morkBead*), /*inValSize*/ 0,
  ioSlotHeap, /*startSlotCount*/ 11, 
  /*inZeroIsClearKey*/ morkBool_kTrue)
{
  if ( ev->Good() )
    mNode_Derived = morkDerived_kBeadProbeMap;
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 411 of file morkBead.cpp.

{
  if ( ioBead && ev->Good() )
  {
    morkBead* bead = 0; // old key in the map
    
    mork_bool put = this->MapAtPut(ev, &ioBead, /*val*/ (void*) 0, 
      /*key*/ &bead, /*val*/ (void*) 0);
          
    if ( put ) // replaced an existing key?
    {
      if ( bead != ioBead ) // new bead was not already in table?
        ioBead->AddStrongRef(ev); // now there's another ref
        
      if ( bead && bead != ioBead ) // need to release old node?
        bead->CutStrongRef(ev);
    }
    else
      ioBead->AddStrongRef(ev); // now there's another ref
  }
  else if ( !ioBead )
    ev->NilPointerError();
    
  return ev->Good();
}

Here is the call graph for this function:

mork_uses morkNode::AddStrongRef ( morkEnv ev) [virtual, inherited]

Reimplemented in morkTable.

Definition at line 510 of file morkNode.cpp.

{
  mork_uses outUses = 0;
  if ( this )
  {
    if ( this->IsNode() )
    {
      mork_uses uses = mNode_Uses;
      mork_refs refs = mNode_Refs;
      if ( refs < uses ) // need to fix broken refs/uses relation?
      { 
        this->RefsUnderUsesWarning(ev);
        mNode_Refs = mNode_Uses = refs = uses;
      }
      if ( refs < morkNode_kMaxRefCount ) // not too great?
      {
        mNode_Refs = ++refs;
        mNode_Uses = ++uses;
      }
      else
        this->RefsOverflowWarning(ev);

      outUses = uses;
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
  return outUses;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_refs morkNode::AddWeakRef ( morkEnv ev) [inherited]

Definition at line 599 of file morkNode.cpp.

{
  mork_refs outRefs = 0;
  if ( this )
  {
    if ( this->IsNode() )
    {
      mork_refs refs = mNode_Refs;
      if ( refs < morkNode_kMaxRefCount ) // not too great?
        mNode_Refs = ++refs;
      else
        this->RefsOverflowWarning(ev);
        
      outRefs = refs;
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
  return outRefs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkNode::BadRefs ( ) const [inline, inherited]

Definition at line 217 of file morkNode.h.

{ return mNode_Refs < mNode_Uses; }
void * morkProbeMap::clear_alloc ( morkEnv ev,
mork_size  inSize 
) [protected, inherited]

Definition at line 487 of file morkProbeMap.cpp.

{
  void* p = 0;
  nsIMdbHeap* heap = sMap_Heap;
  if ( heap )
  {
    if ( heap->Alloc(ev->AsMdbEnv(), inSize, (void**) &p) == 0 && p )
    {
      MORK_MEMSET(p, 0, inSize);
      return p;
    }
  }
  else
    ev->NilPointerError();
    
  return (void*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkProbeMap::clear_probe_map ( morkEnv ev,
nsIMdbHeap ioMapHeap 
) [protected, inherited]

Definition at line 634 of file morkProbeMap.cpp.

{
  sProbeMap_Tag = 0;
  sMap_Seed = 0;
  sMap_Slots = 0;
  sMap_Fill = 0;
  sMap_Keys = 0;
  sMap_Vals = 0;
  sProbeMap_MaxFill = 0;
  
  sMap_Heap = ioMapHeap;
  if ( !ioMapHeap )
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 348 of file morkBead.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      this->CutAllBeads(ev);
      this->CloseProbeMap(ev);
      this->MarkShut();
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

mdb_err morkNode::CloseMdbObject ( morkEnv ev) [inherited]

Definition at line 243 of file morkNode.cpp.

{
  // if only one ref, Handle_CutStrongRef will clean up better.
  if (mNode_Uses == 1)
    return CutStrongRef(ev);

  mdb_err outErr = 0;
  
  if ( IsNode() && IsOpenNode() )
  {
    if ( ev )
    {
      CloseMorkNode(ev);
      outErr = ev->AsErr();
    }
  }
  return outErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in orkinFactory, orkinPortTableCursor, orkinRowCellCursor, orkinRow, orkinTableRowCursor, orkinThumb, morkStore, orkinCell, orkinEnv, orkinFile, orkinSorting, orkinStore, orkinTable, morkObject, and morkCursor.

Definition at line 238 of file morkNode.cpp.

{
  return morkNode::CloseMdbObject((morkEnv *) mev);
}

Here is the call graph for this function:

Reimplemented from morkProbeMap.

Definition at line 318 of file morkBead.cpp.

{
  if ( this->IsOpenNode() )
  {
    this->MarkClosing();
    this->CloseBeadProbeMap(ev);
    this->MarkShut();
  }
}

Here is the call graph for this function:

void morkNode::CloseNode ( morkEnv ev) [inherited]

Definition at line 384 of file morkNode.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
      this->MarkShut();
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkProbeMap::CloseProbeMap ( morkEnv ev) [inherited]

Definition at line 447 of file morkProbeMap.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      nsIMdbHeap* heap = sMap_Heap;
      if ( heap ) // able to free map arrays?
      {
        void* block = sMap_Keys;
        if ( block )
        {
          heap->Free(ev->AsMdbEnv(), block);
          sMap_Keys = 0;
        }
          
        block = sMap_Vals;
        if ( block )
        {
          heap->Free(ev->AsMdbEnv(), block);
          sMap_Vals = 0;
        }
      }
      sMap_Keys = 0;
      sMap_Vals = 0;
      
      this->CloseNode(ev);
      sProbeMap_Tag = 0;
      sProbeMap_MaxFill = 0;
      
      this->MarkShut();
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 451 of file morkBead.cpp.

{
  mork_num outSlots = sMap_Slots;
  
  morkBeadProbeMapIter i(ev, this);
  morkBead* b = i.FirstBead(ev);

  while ( b )
  {
    b->CutStrongRef(ev);
    b = i.NextBead(ev);
  }
  this->MapCutAll(ev);
  
  return outSlots;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_uses morkNode::CutStrongRef ( morkEnv ev) [virtual, inherited]

Reimplemented in morkTable.

Definition at line 580 of file morkNode.cpp.

{
  mork_refs outRefs = 0;
  if ( this )
  {
    if ( this->IsNode() )
    {
      if ( this->cut_use_count(ev) )
        outRefs = this->CutWeakRef(ev);
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
  return outRefs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_refs morkNode::CutWeakRef ( morkEnv ev) [inherited]

Definition at line 623 of file morkNode.cpp.

{
  mork_refs outRefs = 0;
  if ( this )
  {
    if ( this->IsNode() )
    {
      mork_uses uses = mNode_Uses;
      mork_refs refs = mNode_Refs;
      if ( refs ) // not yet zero?
        mNode_Refs = --refs;
      else
        this->RefsUnderflowWarning(ev);

      if ( refs < uses ) // need to fix broken refs/uses relation?
      { 
        this->RefsUnderUsesWarning(ev);
        mNode_Refs = mNode_Uses = refs = uses;
      }
        
      outRefs = refs;
      if ( !refs ) // last reference gone? time to destroy node?
        this->ZapOld(ev, mNode_Heap); // self destroy, use this no longer
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
  return outRefs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_test morkProbeMap::find_key_pos ( morkEnv ev,
const void inAppKey,
mork_u4  inHash,
mork_pos outPos 
) const [protected, inherited]

Definition at line 292 of file morkProbeMap.cpp.

{
  mork_u1* k = sMap_Keys;        // array of keys, each of size sMap_KeySize
  mork_num size = sMap_KeySize;  // number of bytes in each key
  mork_count slots = sMap_Slots; // total number of key buckets
  mork_pos i = inHash % slots;   // target hash bucket
  mork_pos startPos = i;         // remember start to detect
  
  mork_test outTest = this->MapTest(ev, k + (i * size), inAppKey);
  while ( outTest == morkTest_kMiss )
  {
    if ( ++i >= (mork_pos)slots ) // advancing goes beyond end? need to wrap around now?
      i = 0; // wrap around to first slot in map's hash table
      
    if ( i == startPos ) // no void slots were found anywhere in map?
    {
      this->WrapWithNoVoidSlotError(ev); // should never happen
      break; // end loop on kMiss; note caller expects either kVoid or kHit
    }
    outTest = this->MapTest(ev, k + (i * size), inAppKey);
  }
  *outPos = i;
  
  return outTest;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkProbeMap::get_probe_kv ( morkEnv ev,
void outAppKey,
void outAppVal,
mork_pos  inPos 
) const [protected, inherited]

Definition at line 263 of file morkProbeMap.cpp.

{
  const mork_u1* mapVal = 0;
  const mork_u1* mapKey = 0;

  mork_num valSize = sMap_ValSize;
  if ( valSize && outAppVal ) // map holds values? caller wants value?
  {
    const mork_u1* val = sMap_Vals + (valSize * inPos);
    if ( valSize == sizeof(mork_ip) && sMap_ValIsIP ) // int special case? 
      *((mork_ip*) outAppVal) = *((const mork_ip*) val);
    else
      mapVal = val; // show possible need to call ProbeMapPullOut()
  }
  if ( outAppKey ) // caller wants the key? 
  {
    mork_num keySize = sMap_KeySize;
    const mork_u1* key = sMap_Keys + (keySize * inPos);
    if ( keySize == sizeof(mork_ip) && sMap_KeyIsIP ) // int special case? 
      *((mork_ip*) outAppKey) = *((const mork_ip*) key);
    else
      mapKey = key; // show possible need to call ProbeMapPullOut()
  }
  if ( ( outAppVal && mapVal ) || ( outAppKey && mapKey ) )
    this->ProbeMapPullOut(ev, mapKey, mapVal, outAppKey, outAppVal);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 438 of file morkBead.cpp.

{
  morkBead* oldBead = 0; // old key in the map
  morkBead bead(inColor);
  morkBead* key = &bead;

  this->MapAt(ev, &key, &oldBead, /*val*/ (void*) 0);
  
  bead.CloseBead(ev);
  return oldBead;
}

Here is the call graph for this function:

const char * morkNode::GetNodeAccessAsString ( ) const [inherited]

Definition at line 658 of file morkNode.cpp.

{
  const char* outString = morkNode_kBroken;
  switch( mNode_Access )
  {
    case morkAccess_kOpen: outString = "open"; break;
    case morkAccess_kClosing: outString = "closing"; break;
    case morkAccess_kShut: outString = "shut"; break;
    case morkAccess_kDead: outString = "dead"; break;
  }
  return outString;
}
const char * morkNode::GetNodeUsageAsString ( ) const [inherited]

Definition at line 672 of file morkNode.cpp.

{
  const char* outString = morkNode_kBroken;
  switch( mNode_Usage )
  {
    case morkUsage_kHeap: outString = "heap"; break;
    case morkUsage_kStack: outString = "stack"; break;
    case morkUsage_kMember: outString = "member"; break;
    case morkUsage_kGlobal: outString = "global"; break;
    case morkUsage_kPool: outString = "pool"; break;
    case morkUsage_kNone: outString = "none"; break;
  }
  return outString;
}
mork_bool morkProbeMap::GoodProbeMap ( ) const [inline, inherited]

Definition at line 146 of file morkProbeMap.h.

Here is the caller graph for this function:

mork_bool morkNode::GoodRefs ( ) const [inline, inherited]

Definition at line 216 of file morkNode.h.

{ return mNode_Refs >= mNode_Uses; }
mork_bool morkProbeMap::grow_probe_map ( morkEnv ev) [protected, inherited]

Definition at line 181 of file morkProbeMap.cpp.

{
  if ( sMap_Heap ) // can we grow the map?
  {
    mork_num newSlots = ((sMap_Slots * 4) / 3) + 1; // +25%
    morkMapScratch old; // a place to temporarily hold all the old arrays
    if ( this->new_slots(ev, &old, newSlots) ) // have more?
    {      
      ++sMap_Seed; // note the map has changed
      this->rehash_old_map(ev, &old);
      
      if ( ev->Good() ) 
      {
        mork_count slots = sMap_Slots;
        mork_num emptyReserve = (slots / 7) + 1; // keep this many empty
        mork_fill maxFill = slots - emptyReserve; // new max occupancy
        if ( maxFill > sMap_Fill ) // new max is bigger than old occupancy?
          sProbeMap_MaxFill = maxFill; // we can install new max for fill
        else
          this->GrowFailsMaxFillError(ev); // we have invariant failure
      }
      
      if ( ev->Bad() ) // rehash failed? need to revert map to last state?
        this->revert_map(ev, &old); // swap the vectors back again

      old.halt_map_scratch(ev); // remember to free the old arrays
    }
  }
  else ev->OutOfMemoryError();
  
  return ev->Good();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkProbeMap::GrowFailsMaxFillError ( morkEnv ev) const [inherited]

Definition at line 99 of file morkProbeMap.cpp.

{
  ev->NewError("grow fails morkEnv > sMap_Fill");
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkNode::HasNodeAccess ( ) const [inline, inherited]

Definition at line 251 of file morkNode.h.

  { return ( IsOpenNode() || IsShutNode() || IsClosingNode() ); }

Here is the call graph for this function:

void morkProbeMap::init_probe_map ( morkEnv ev,
mork_size  inSlots 
) [protected, inherited]

Definition at line 558 of file morkProbeMap.cpp.

{
  // Note we cannot successfully call virtual ProbeMapClearKey() when we
  // call init_probe_map() inside the constructor; so we leave this problem
  // to the caller.  (The constructor will call ProbeMapClearKey() later
  // after setting a suitable lazy flag to show this action is pending.)

  if ( ev->Good() )
  {
    morkMapScratch old;

    if ( inSlots < 7 ) // capacity too small?
      inSlots = 7; // increase to reasonable minimum
    else if ( inSlots > (128 * 1024) ) // requested capacity too big?
      inSlots = (128 * 1024); // decrease to reasonable maximum
      
    if ( this->new_slots(ev, &old, inSlots) )
      sProbeMap_Tag = morkProbeMap_kTag;
      
    mork_count slots = sMap_Slots;
    mork_num emptyReserve = (slots / 7) + 1; // keep this many empty
    sProbeMap_MaxFill = slots - emptyReserve;

    MORK_MEMSET(&old, 0, sizeof(morkMapScratch)); // don't bother halting
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkNode::IsAsleep ( ) const [inline, inherited]

Definition at line 142 of file morkNode.h.

Definition at line 214 of file morkBead.h.

Here is the call graph for this function:

mork_bool morkNode::IsClosingNode ( ) const [inline, inherited]

Definition at line 245 of file morkNode.h.

Here is the caller graph for this function:

mork_bool morkNode::IsDeadNode ( ) const [inline, inherited]

Definition at line 242 of file morkNode.h.

Here is the caller graph for this function:

mork_bool morkNode::IsFrozen ( ) const [inline, inherited]

Definition at line 140 of file morkNode.h.

Here is the caller graph for this function:

mork_bool morkNode::IsHeapNode ( ) const [inline, inherited]

Definition at line 233 of file morkNode.h.

  { return mNode_Usage == morkUsage_kHeap; }
mork_bool morkNode::IsMutable ( ) const [inline, inherited]

Definition at line 141 of file morkNode.h.

Here is the caller graph for this function:

mork_bool morkNode::IsNode ( ) const [inline, inherited]

Definition at line 193 of file morkNode.h.

  { return mNode_Base == morkBase_kNode; }
mork_bool morkNode::IsNodeClean ( ) const [inline, inherited]

Definition at line 147 of file morkNode.h.

{ return mNode_Load == morkLoad_kClean; }

Here is the caller graph for this function:

mork_bool morkNode::IsNodeDirty ( ) const [inline, inherited]

Definition at line 148 of file morkNode.h.

{ return mNode_Load == morkLoad_kDirty; }

Here is the caller graph for this function:

mork_bool morkNode::IsOpenNode ( ) const [inline, inherited]

Definition at line 236 of file morkNode.h.

mork_bool morkNode::IsOpenOrClosingNode ( ) const [inline, inherited]

Definition at line 248 of file morkNode.h.

  { return IsOpenNode() || IsClosingNode(); }

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkProbeMap::IsProbeMap ( ) const [inline, inherited]

Definition at line 349 of file morkProbeMap.h.

Here is the call graph for this function:

mork_bool morkNode::IsShutNode ( ) const [inline, inherited]

Definition at line 239 of file morkNode.h.

Here is the caller graph for this function:

void * morkNode::MakeNew ( size_t  inSize,
nsIMdbHeap ioHeap,
morkEnv ev 
) [static, inherited]

Definition at line 177 of file morkNode.cpp.

{
  void* node = 0;
  if ( &ioHeap )
  {
    ioHeap.Alloc(ev->AsMdbEnv(), inSize, (void **) &node);
    if ( !node )
      ev->OutOfMemoryError();
  }
  else
    ev->NilPointerError();
  
  return node;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_u1 * morkProbeMap::map_new_keys ( morkEnv ev,
mork_num  inSlots 
) [protected, inherited]

Definition at line 509 of file morkProbeMap.cpp.

{
  mork_num size = inSlots * sMap_KeySize;
  return (mork_u1*) this->clear_alloc(ev, size);
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_u1 * morkProbeMap::map_new_vals ( morkEnv ev,
mork_num  inSlots 
) [protected, inherited]

Definition at line 521 of file morkProbeMap.cpp.

{
  mork_u1* values = 0;
  mork_num size = inSlots * sMap_ValSize;
  if ( size )
    values = (mork_u1*) this->clear_alloc(ev, size);
  return values;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkProbeMap::MapAt ( morkEnv ev,
const void inAppKey,
void outAppKey,
void outAppVal 
) [virtual, inherited]

Definition at line 386 of file morkProbeMap.cpp.

{
  if ( this->GoodProbeMap() ) /* looks good? */
  {
    if ( this->need_lazy_init() && sMap_Fill == 0 ) // pending lazy action?
      this->probe_map_lazy_init(ev);
          
    mork_pos slotPos = 0;
    mork_u4 hash = this->MapHash(ev, inAppKey);
    mork_test test = this->find_key_pos(ev, inAppKey, hash, &slotPos);
    if ( test == morkTest_kHit ) /* found an assoc pair for inAppKey? */
    {
      this->get_probe_kv(ev, outAppKey, outAppVal, slotPos);
      return morkBool_kTrue;
    }
  }
  else this->ProbeMapBadTagError(ev);
  
  return morkBool_kFalse;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkProbeMap::MapAtPut ( morkEnv ev,
const void inAppKey,
const void inAppVal,
void outAppKey,
void outAppVal 
) [virtual, inherited]

Definition at line 345 of file morkProbeMap.cpp.

{
  mork_bool outPut = morkBool_kFalse;
  
  if ( this->GoodProbeMap() ) /* looks good? */
  {
    if ( this->need_lazy_init() && sMap_Fill == 0 ) // pending lazy action?
      this->probe_map_lazy_init(ev);
          
    if ( ev->Good() )
    {
      mork_pos slotPos = 0;
      mork_u4 hash = this->MapHash(ev, inAppKey);
      mork_test test = this->find_key_pos(ev, inAppKey, hash, &slotPos);
      outPut = ( test == morkTest_kHit );

      if ( outPut ) // replacing an old assoc? no change in member count?
      {
        if ( outAppKey || outAppVal ) /* copy old before cobber? */
          this->get_probe_kv(ev, outAppKey, outAppVal, slotPos);
      }
      else // adding a new assoc increases membership by one
      {
        ++sMap_Fill; /* one more member in the collection */
      }
      
      if ( test != morkTest_kMiss ) /* found slot to hold new assoc? */
      {
        ++sMap_Seed; /* note the map has changed */
        this->put_probe_kv(ev, inAppKey, inAppVal, slotPos);
      }
    }
  }
  else this->ProbeMapBadTagError(ev);
  
  return outPut;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_num morkProbeMap::MapCutAll ( morkEnv ev) [virtual, inherited]

Definition at line 409 of file morkProbeMap.cpp.

{
  mork_num outCutAll = 0;
  
  if ( this->GoodProbeMap() ) /* looks good? */
  {
    outCutAll = sMap_Fill; /* number of members cut, which is all of them */
    
    if ( sMap_Keys && !sProbeMap_ZeroIsClearKey )
      this->ProbeMapClearKey(ev, sMap_Keys, sMap_Slots);

    sMap_Fill = 0; /* map now has no members */
  }
  else this->ProbeMapBadTagError(ev);
  
  return outCutAll;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_fill morkProbeMap::MapFill ( ) const [inline, inherited]

Definition at line 119 of file morkProbeMap.h.

{ return sMap_Fill; }

Definition at line 536 of file morkProbeMap.cpp.

{
  ev->NewWarning("sMap_Fill underflow");
}

Here is the call graph for this function:

mork_u4 morkBeadProbeMap::MapHash ( morkEnv ev,
const void inAppKey 
) const [virtual]

Reimplemented from morkProbeMap.

Definition at line 384 of file morkBead.cpp.

{
  const morkBead* key = *(const morkBead**) inAppKey;
  if ( key )
    return key->BeadHash();
  else
  {
    ev->NilPointerWarning();
    return 0;
  }
}

Here is the call graph for this function:

mork_bool morkProbeMap::MapKeyIsIP ( ) const [inline, inherited]

Definition at line 124 of file morkProbeMap.h.

{ return sMap_KeyIsIP; }
void morkProbeMap::MapKeyIsNotIPError ( morkEnv ev) const [inherited]

Definition at line 104 of file morkProbeMap.cpp.

{
  ev->NewError("not sMap_KeyIsIP");
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_size morkProbeMap::MapKeySize ( ) const [inline, inherited]

Definition at line 121 of file morkProbeMap.h.

{ return sMap_KeySize; }

Definition at line 541 of file morkProbeMap.cpp.

{
  ev->NewError("nil sMap_Keys");
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_count morkProbeMap::MapSeed ( ) const [inline, inherited]

Definition at line 116 of file morkProbeMap.h.

{ return sMap_Seed; }

Definition at line 531 of file morkProbeMap.cpp.

{
  ev->NewError("sMap_Seed out of sync");
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_count morkProbeMap::MapSlots ( ) const [inline, inherited]

Definition at line 118 of file morkProbeMap.h.

{ return sMap_Slots; }
mork_test morkBeadProbeMap::MapTest ( morkEnv ev,
const void inMapKey,
const void inAppKey 
) const [virtual]

Reimplemented from morkProbeMap.

Definition at line 369 of file morkBead.cpp.

{
  MORK_USED_1(ev);
  const morkBead* key = *(const morkBead**) inMapKey;
  if ( key )
  {
    mork_bool hit = key->BeadEqual(*(const morkBead**) inAppKey);
    return ( hit ) ? morkTest_kHit : morkTest_kMiss;
  }
  else
    return morkTest_kVoid;
}

Here is the call graph for this function:

mork_bool morkProbeMap::MapValIsIP ( ) const [inline, inherited]

Definition at line 125 of file morkProbeMap.h.

{ return sMap_ValIsIP; }
void morkProbeMap::MapValIsNotIPError ( morkEnv ev) const [inherited]

Definition at line 109 of file morkProbeMap.cpp.

{
  ev->NewError("not sMap_ValIsIP");
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_size morkProbeMap::MapValSize ( ) const [inline, inherited]

Definition at line 122 of file morkProbeMap.h.

{ return sMap_ValSize; }

Definition at line 546 of file morkProbeMap.cpp.

{
  ev->NewError("zero sMap_KeySize");
}

Here is the call graph for this function:

void morkNode::MarkClosing ( ) [inline, inherited]

Definition at line 255 of file morkNode.h.

void morkNode::MarkDead ( ) [inline, inherited]

Definition at line 256 of file morkNode.h.

void morkNode::MarkShut ( ) [inline, inherited]

Definition at line 254 of file morkNode.h.

mork_bool morkProbeMap::need_lazy_init ( ) const [inline, inherited]

Definition at line 142 of file morkProbeMap.h.

Here is the caller graph for this function:

mork_bool morkProbeMap::new_slots ( morkEnv ev,
morkMapScratch old,
mork_num  inSlots 
) [protected, inherited]

Definition at line 586 of file morkProbeMap.cpp.

{
  mork_bool outNew = morkBool_kFalse;
  
  // Note we cannot successfully call virtual ProbeMapClearKey() when we
  // call new_slots() inside the constructor; so we leave this problem
  // to the caller.  (The constructor will call ProbeMapClearKey() later
  // after setting a suitable lazy flag to show this action is pending.)
    
  // allocate every new array before we continue:
  mork_u1* newKeys = this->map_new_keys(ev, inSlots);
  mork_u1* newVals = this->map_new_vals(ev, inSlots);
  
  // okay for newVals to be null when values are zero sized?
  mork_bool okayValues = ( newVals || !sMap_ValSize );
  
  if ( newKeys && okayValues )
  {
    outNew = morkBool_kTrue; // we created every array needed

    // init mapScratch using slots from current map:
    old->sMapScratch_Heap = sMap_Heap;
    
    old->sMapScratch_Slots = sMap_Slots;
    old->sMapScratch_Keys = sMap_Keys;
    old->sMapScratch_Vals = sMap_Vals;
    
    // replace all map array slots using the newly allocated members:
    ++sMap_Seed; // the map has changed
    sMap_Keys = newKeys;
    sMap_Vals = newVals;
    sMap_Slots = inSlots;
  }
  else // free any allocations if only partially successful
  {
    nsIMdbHeap* heap = sMap_Heap;
    if ( newKeys )
      heap->Free(ev->AsMdbEnv(), newKeys);
    if ( newVals )
      heap->Free(ev->AsMdbEnv(), newVals);
    
    MORK_MEMSET(old, 0, sizeof(morkMapScratch)); // zap scratch space
  }
  
  return outNew;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkNode::NilHeapError ( morkEnv ev) const [inherited]

Definition at line 354 of file morkNode.cpp.

{
  ev->NewError("nil mNode_Heap");
}

Here is the caller graph for this function:

mork_usage morkNode::NodeUsage ( ) const [inline, inherited]

Definition at line 231 of file morkNode.h.

{ return mNode_Usage; }
void morkNode::NonMutableNodeError ( morkEnv ev) const [inherited]

Definition at line 348 of file morkNode.cpp.

{
  ev->NewError("non-mutable-morkNode");
}

Here is the caller graph for this function:

void morkNode::NonNodeError ( morkEnv ev) const [inherited]

Definition at line 336 of file morkNode.cpp.

{
  ev->NewError("non-morkNode");
}
void morkNode::NonOpenNodeError ( morkEnv ev) const [inherited]

Definition at line 342 of file morkNode.cpp.

{
  ev->NewError("non-open-morkNode");
}

Here is the caller graph for this function:

void* morkNode::operator new ( size_t  inSize,
nsIMdbHeap ioHeap,
morkEnv ev 
) [inline, inherited]

Reimplemented in morkTable, morkFactory, morkPool, and morkSorting.

Definition at line 159 of file morkNode.h.

  { return morkNode::MakeNew(inSize, ioHeap, ev); }

Here is the call graph for this function:

void morkProbeMap::probe_map_lazy_init ( morkEnv ev) [protected, inherited]

Definition at line 319 of file morkProbeMap.cpp.

{
  if ( this->need_lazy_init() && sMap_Fill == 0 ) // pending lazy action?
  {
    // The constructor cannot successfully call virtual ProbeMapClearKey(),
    // so we lazily do so now, when we add the first member to the map.
    
    mork_u1* keys = sMap_Keys;
    if ( keys ) // okay to call lazy virtual clear method on new map keys?
    {
      if ( sProbeMap_ZeroIsClearKey ) // zero is good enough to clear keys?
      {
        mork_num keyVolume = sMap_Slots * sMap_KeySize;
        if ( keyVolume )
          MORK_MEMSET(keys, 0, keyVolume);
      }
      else
        this->ProbeMapClearKey(ev, keys, sMap_Slots);
    }
    else
      this->MapNilKeysError(ev);
  }
  sProbeMap_LazyClearOnAdd = 0; // don't do this ever again
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkProbeMap::ProbeMapBadTagError ( morkEnv ev) const [inherited]

Definition at line 87 of file morkProbeMap.cpp.

{
  ev->NewError("bad sProbeMap_Tag");
  if ( !this )
    ev->NewError("nil morkProbeMap");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkProbeMap::ProbeMapClearKey ( morkEnv ev,
void ioMapKey,
mork_count  inKeyCount 
) [virtual, inherited]

Definition at line 837 of file morkProbeMap.cpp.

{
  if ( ioMapKey && inKeyCount )
  {
    MORK_MEMSET(ioMapKey, 0, (inKeyCount * sMap_KeySize));
  }
  else
    ev->NilPointerWarning();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkProbeMap::ProbeMapCutError ( morkEnv ev) [static, inherited]

Definition at line 552 of file morkProbeMap.cpp.

{
  ev->NewError("morkProbeMap cannot cut");
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_u4 morkBeadProbeMap::ProbeMapHashMapKey ( morkEnv ev,
const void inMapKey 
) const [virtual]

Reimplemented from morkProbeMap.

Definition at line 397 of file morkBead.cpp.

{
  const morkBead* key = *(const morkBead**) inMapKey;
  if ( key )
    return key->BeadHash();
  else
  {
    ev->NilPointerWarning();
    return 0;
  }
}

Here is the call graph for this function:

mork_bool morkProbeMap::ProbeMapIsKeyNil ( morkEnv ev,
void ioMapKey 
) [virtual, inherited]

Definition at line 810 of file morkProbeMap.cpp.

{
  if ( sMap_KeySize == sizeof(mork_ip) && sMap_KeyIsIP )
  {
    return !*((const mork_ip*) ioMapKey);
  }
  else
  {
    const mork_u1* key = (const mork_u1*) ioMapKey;
    const mork_u1* end = key + sMap_KeySize;
    --key; // prepare for preincrement:
    while ( ++key < end )
    {
      if ( *key ) // any nonzero byte in map key means slot is not nil?
        return morkBool_kFalse;
    }
    return morkBool_kTrue;
  }
}

Here is the caller graph for this function:

void morkProbeMap::ProbeMapPullOut ( morkEnv ev,
const void inMapKey,
const void inMapVal,
void outAppKey,
void outAppVal 
) const [virtual, inherited]

Definition at line 895 of file morkProbeMap.cpp.

{
}

Here is the caller graph for this function:

void morkProbeMap::ProbeMapPushIn ( morkEnv ev,
const void inAppKey,
const void inAppVal,
void outMapKey,
void outMapVal 
) [virtual, inherited]

Definition at line 865 of file morkProbeMap.cpp.

{
}

Here is the caller graph for this function:

void morkProbeMap::put_probe_kv ( morkEnv ev,
const void inAppKey,
const void inAppVal,
mork_pos  inPos 
) [protected, inherited]

Definition at line 229 of file morkProbeMap.cpp.

{
  mork_u1* mapVal = 0;
  mork_u1* mapKey = 0;

  mork_num valSize = sMap_ValSize;
  if ( valSize && inAppVal ) // map holds values? caller sends value?
  {
    mork_u1* val = sMap_Vals + (valSize * inPos);
    if ( valSize == sizeof(mork_ip) && sMap_ValIsIP ) // int special case? 
      *((mork_ip*) val) = *((const mork_ip*) inAppVal);
    else
      mapVal = val; // show possible need to call ProbeMapPushIn()
  }
  if ( inAppKey ) // caller sends the key? 
  {
    mork_num keySize = sMap_KeySize;
    mork_u1* key = sMap_Keys + (keySize * inPos);
    if ( keySize == sizeof(mork_ip) && sMap_KeyIsIP ) // int special case? 
      *((mork_ip*) key) = *((const mork_ip*) inAppKey);
    else
      mapKey = key; // show possible need to call ProbeMapPushIn()
  }
  else
    ev->NilPointerError();

  if ( (  inAppVal && mapVal ) || ( inAppKey && mapKey ) )
    this->ProbeMapPushIn(ev, inAppKey, inAppVal, mapKey, mapVal);

  if ( sMap_Fill > sProbeMap_MaxFill )
    this->grow_probe_map(ev);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkNode::RefsOverflowWarning ( morkEnv ev) const [inherited]

Definition at line 360 of file morkNode.cpp.

{
  ev->NewWarning("mNode_Refs overflow");
}

Here is the caller graph for this function:

void morkNode::RefsUnderflowWarning ( morkEnv ev) const [inherited]

Definition at line 372 of file morkNode.cpp.

{
  ev->NewWarning("mNode_Refs underflow");
}

Here is the caller graph for this function:

void morkNode::RefsUnderUsesWarning ( morkEnv ev) const [inherited]

Definition at line 330 of file morkNode.cpp.

{
  ev->NewError("mNode_Refs < mNode_Uses");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkProbeMap::rehash_old_map ( morkEnv ev,
morkMapScratch ioScratch 
) [protected, inherited]

Definition at line 114 of file morkProbeMap.cpp.

{
  mork_size keySize = sMap_KeySize; // size of every key bucket
  mork_size valSize = sMap_ValSize; // size of every associated value
  
  mork_count slots = sMap_Slots; // number of new buckets
  mork_u1* keys = sMap_Keys; // destination for rehashed keys
  mork_u1* vals = sMap_Vals; // destination for any copied values
  
  mork_bool keyIsIP = ( keys && keySize == sizeof(mork_ip) && sMap_KeyIsIP );
  mork_bool valIsIP = ( vals && valSize == sizeof(mork_ip) && sMap_ValIsIP );

  mork_count oldSlots = ioScratch->sMapScratch_Slots; // sMap_Slots
  mork_u1* oldKeys = ioScratch->sMapScratch_Keys; // sMap_Keys
  mork_u1* oldVals = ioScratch->sMapScratch_Vals; // sMap_Vals
  mork_u1* end = oldKeys + (keySize * oldSlots); // one byte past last key
  
  mork_fill fill = 0; // let's count the actual fill for a double check
  
  while ( oldKeys < end ) // another old key bucket to rehash if non-nil?
  {
    if ( !this->ProbeMapIsKeyNil(ev, oldKeys) ) // need to rehash?
    {
      ++fill; // this had better match sMap_Fill when we are all done
      mork_u4 hash = this->ProbeMapHashMapKey(ev, oldKeys);

      mork_pos i = hash % slots;   // target hash bucket
      mork_pos startPos = i;       // remember start to detect
      
      mork_u1* k = keys + (i * keySize);
      while ( !this->ProbeMapIsKeyNil(ev, k) )
      {
        if ( ++i >= (mork_pos)slots ) // advanced past end? need to wrap around now?
          i = 0; // wrap around to first slot in map's hash table
          
        if ( i == startPos ) // no void slots were found anywhere in map?
        {
          this->WrapWithNoVoidSlotError(ev); // should never happen
          return; // this is bad, and we can't go on with the rehash
        }
        k = keys + (i * keySize);
      }
      if ( keyIsIP ) // int special case?
        *((mork_ip*) k) = *((const mork_ip*) oldKeys); // fast bitwise copy
      else
        MORK_MEMCPY(k, oldKeys, keySize); // slow bitwise copy

      if ( oldVals ) // need to copy values as well?
      {
        mork_size valOffset = (i * valSize);
        mork_u1* v = vals + valOffset;
        mork_u1* ov = oldVals + valOffset;
        if ( valIsIP ) // int special case?
          *((mork_ip*) v) = *((const mork_ip*) ov); // fast bitwise copy
        else
          MORK_MEMCPY(v, ov, valSize); // slow bitwise copy
      }
    }
    oldKeys += keySize; // advance to next key bucket in old map
  }
  if ( fill != sMap_Fill ) // is the recorded value of sMap_Fill wrong?
  {
    ev->NewWarning("fill != sMap_Fill");
    sMap_Fill = fill;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkProbeMap::revert_map ( morkEnv ev,
morkMapScratch ioScratch 
) [protected, inherited]

Definition at line 214 of file morkProbeMap.cpp.

{
  mork_count tempSlots = ioScratch->sMapScratch_Slots; // sMap_Slots  
  mork_u1* tempKeys = ioScratch->sMapScratch_Keys;     // sMap_Keys
  mork_u1* tempVals = ioScratch->sMapScratch_Vals;     // sMap_Vals
  
  ioScratch->sMapScratch_Slots = sMap_Slots;
  ioScratch->sMapScratch_Keys = sMap_Keys;
  ioScratch->sMapScratch_Vals = sMap_Vals;
  
  sMap_Slots = tempSlots;
  sMap_Keys = tempKeys;
  sMap_Vals = tempVals;
}

Here is the caller graph for this function:

void morkNode::SetAsleep ( ) [inline, inherited]

Definition at line 138 of file morkNode.h.

void morkNode::SetFrozen ( ) [inline, inherited]

Definition at line 136 of file morkNode.h.

void morkNode::SetMutable ( ) [inline, inherited]

Definition at line 137 of file morkNode.h.

void morkNode::SetNodeClean ( ) [inline, inherited]

Definition at line 144 of file morkNode.h.

Here is the caller graph for this function:

void morkNode::SetNodeDirty ( ) [inline, inherited]

Definition at line 145 of file morkNode.h.

Here is the caller graph for this function:

static void morkProbeMap::SlotStrongMap ( morkMap me,
morkEnv ev,
morkMap **  ioSlot 
) [inline, static, inherited]

Definition at line 358 of file morkProbeMap.h.

  { morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }

Here is the call graph for this function:

void morkNode::SlotStrongNode ( morkNode me,
morkEnv ev,
morkNode **  ioSlot 
) [static, inherited]

Definition at line 466 of file morkNode.cpp.

{
  morkNode* node = *ioSlot;
  if ( me != node )
  {
    if ( node )
    {
      // what if this nulls out the ev and causes asserts?
      // can we move this after the CutStrongRef()?
      *ioSlot = 0;
      node->CutStrongRef(ev);
    }
    if ( me && me->AddStrongRef(ev) )
      *ioSlot = me;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void morkProbeMap::SlotWeakMap ( morkMap me,
morkEnv ev,
morkMap **  ioSlot 
) [inline, static, inherited]

Definition at line 354 of file morkProbeMap.h.

  { morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }

Here is the call graph for this function:

void morkNode::SlotWeakNode ( morkNode me,
morkEnv ev,
morkNode **  ioSlot 
) [static, inherited]

Definition at line 489 of file morkNode.cpp.

{
  morkNode* node = *ioSlot;
  if ( me != node )
  {
    if ( node )
    {
      *ioSlot = 0;
      node->CutWeakRef(ev);
    }
    if ( me && me->AddWeakRef(ev) )
      *ioSlot = me;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_uses morkNode::StrongRefsOnly ( ) const [inline, inherited]

Definition at line 219 of file morkNode.h.

{ return mNode_Uses; }

Here is the caller graph for this function:

void morkNode::UsesOverflowWarning ( morkEnv ev) const [inherited]

Definition at line 366 of file morkNode.cpp.

{
  ev->NewWarning("mNode_Uses overflow");
}
void morkNode::UsesUnderflowWarning ( morkEnv ev) const [inherited]

Definition at line 378 of file morkNode.cpp.

{
  ev->NewWarning("mNode_Uses underflow");
}

Here is the caller graph for this function:

mork_refs morkNode::WeakRefsOnly ( ) const [inline, inherited]

Definition at line 220 of file morkNode.h.

{ return (mork_refs) ( mNode_Refs - mNode_Uses ); }

Here is the caller graph for this function:

void morkProbeMap::WrapWithNoVoidSlotError ( morkEnv ev) const [inherited]

Definition at line 94 of file morkProbeMap.cpp.

{
  ev->NewError("wrap without void morkProbeMap slot");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkNode::ZapOld ( morkEnv ev,
nsIMdbHeap ioHeap 
) [inherited]

Definition at line 193 of file morkNode.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      mork_usage usage = mNode_Usage; // mNode_Usage before ~morkNode
      this->morkNode::~morkNode(); // first call polymorphic destructor
      if ( ioHeap ) // was this node heap allocated?
        ioHeap->Free(ev->AsMdbEnv(), this);
      else if ( usage == morkUsage_kPool ) // mNode_Usage before ~morkNode
      {
        morkHandle* h = (morkHandle*) this;
        if ( h->IsHandle() && h->GoodHandleTag() )
        {
          if ( h->mHandle_Face )
          {
            if (ev->mEnv_HandlePool)
              ev->mEnv_HandlePool->ZapHandle(ev, h->mHandle_Face);
            else if (h->mHandle_Env && h->mHandle_Env->mEnv_HandlePool)
              h->mHandle_Env->mEnv_HandlePool->ZapHandle(ev, h->mHandle_Face);
          }
          else
            ev->NilPointerError();
        }
      }
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class morkHandleFrame [friend, inherited]

Reimplemented in morkHandle.

Definition at line 131 of file morkNode.h.

friend class morkProbeMapIter [friend, inherited]

Definition at line 113 of file morkProbeMap.h.


Member Data Documentation

Definition at line 122 of file morkNode.h.

Definition at line 119 of file morkNode.h.

Definition at line 120 of file morkNode.h.

Definition at line 117 of file morkNode.h.

Definition at line 125 of file morkNode.h.

Definition at line 124 of file morkNode.h.

Definition at line 128 of file morkNode.h.

Definition at line 123 of file morkNode.h.

Definition at line 127 of file morkNode.h.

mork_fill morkProbeMap::sMap_Fill [protected, inherited]

Definition at line 103 of file morkProbeMap.h.

nsIMdbHeap* morkProbeMap::sMap_Heap [protected, inherited]

Definition at line 95 of file morkProbeMap.h.

mork_bool morkProbeMap::sMap_KeyIsIP [protected, inherited]

Definition at line 108 of file morkProbeMap.h.

mork_u1* morkProbeMap::sMap_Keys [protected, inherited]

Definition at line 97 of file morkProbeMap.h.

mork_size morkProbeMap::sMap_KeySize [protected, inherited]

Definition at line 105 of file morkProbeMap.h.

mork_u1 morkProbeMap::sMap_Pad[2] [protected, inherited]

Definition at line 110 of file morkProbeMap.h.

mork_count morkProbeMap::sMap_Seed [protected, inherited]

Definition at line 100 of file morkProbeMap.h.

mork_count morkProbeMap::sMap_Slots [protected, inherited]

Definition at line 102 of file morkProbeMap.h.

mork_bool morkProbeMap::sMap_ValIsIP [protected, inherited]

Definition at line 109 of file morkProbeMap.h.

mork_u1* morkProbeMap::sMap_Vals [protected, inherited]

Definition at line 98 of file morkProbeMap.h.

mork_size morkProbeMap::sMap_ValSize [protected, inherited]

Definition at line 106 of file morkProbeMap.h.

Definition at line 132 of file morkProbeMap.h.

Definition at line 130 of file morkProbeMap.h.

mork_u1 morkProbeMap::sProbeMap_Pad[2] [protected, inherited]

Definition at line 134 of file morkProbeMap.h.

mork_u4 morkProbeMap::sProbeMap_Tag [protected, inherited]

Definition at line 136 of file morkProbeMap.h.

Definition at line 133 of file morkProbeMap.h.


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