Back to index

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

#include <morkAtomMap.h>

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

List of all members.

Public Member Functions

virtual void CloseMorkNode (morkEnv *ev)
virtual ~morkAtomAidMap ()
 morkAtomAidMap (morkEnv *ev, const morkUsage &inUsage, nsIMdbHeap *ioHeap, nsIMdbHeap *ioSlotHeap)
void CloseAtomAidMap (morkEnv *ev)
mork_bool IsAtomAidMap () const
virtual mork_bool Equal (morkEnv *ev, const void *inKeyA, const void *inKeyB) const
virtual mork_u4 Hash (morkEnv *ev, const void *inKey) const
mork_bool AddAtom (morkEnv *ev, morkBookAtom *ioAtom)
morkBookAtomCutAtom (morkEnv *ev, const morkBookAtom *inAtom)
morkBookAtomGetAtom (morkEnv *ev, const morkBookAtom *inAtom)
morkBookAtomGetAid (morkEnv *ev, mork_aid inAid)
mork_fill MapFill () const
void CloseMap (morkEnv *ev)
mork_bool IsMap () const
mork_bool GoodMapTag () const
mork_bool GoodMap () const
void NewIterOutOfSyncError (morkEnv *ev)
void NewBadMapError (morkEnv *ev)
void NewSlotsUnderflowWarning (morkEnv *ev)
void InitMap (morkEnv *ev, mork_size inSlots)
mork_size FormKeySize () const
mork_size FormValSize () const
mork_bool FormKeyIsIP () const
mork_bool FormValIsIP () const
mork_bool FormHoldChanges () const
mork_changeFormDummyChange ()
mork_bool Put (morkEnv *ev, const void *inKey, const void *inVal, void *outKey, void *outVal, mork_change **outChange)
mork_bool Cut (morkEnv *ev, const void *inKey, void *outKey, void *outVal, mork_change **outChange)
mork_bool Get (morkEnv *ev, const void *inKey, void *outKey, void *outVal, mork_change **outChange)
mork_num CutAll (morkEnv *ev)
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 SlotWeakAtomAidMap (morkAtomAidMap *me, morkEnv *ev, morkAtomAidMap **ioSlot)
static void SlotStrongAtomAidMap (morkAtomAidMap *me, morkEnv *ev, morkAtomAidMap **ioSlot)
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

nsIMdbHeapmMap_Heap
mork_u4 mMap_Tag
morkMapForm mMap_Form
mork_seed mMap_Seed
mork_count mMap_Slots
mork_fill mMap_Fill
mork_u1mMap_Keys
mork_u1mMap_Vals
morkAssocmMap_Assocs
mork_changemMap_Changes
morkAssoc ** mMap_Buckets
morkAssocmMap_FreeList
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

void clear_map (morkEnv *ev, nsIMdbHeap *ioHeap)
voidalloc (morkEnv *ev, mork_size inSize)
voidclear_alloc (morkEnv *ev, mork_size inSize)
void push_free_assoc (morkAssoc *ioAssoc)
morkAssocpop_free_assoc ()
morkAssoc ** find (morkEnv *ev, const void *inKey, mork_u4 inHash) const
mork_u1new_keys (morkEnv *ev, mork_num inSlots)
mork_u1new_values (morkEnv *ev, mork_num inSlots)
mork_changenew_changes (morkEnv *ev, mork_num inSlots)
morkAssoc ** new_buckets (morkEnv *ev, mork_num inSlots)
morkAssocnew_assocs (morkEnv *ev, mork_num inSlots)
mork_bool new_arrays (morkEnv *ev, morkHashArrays *old, mork_num inSlots)
mork_bool grow (morkEnv *ev)
void get_assoc (void *outKey, void *outVal, mork_pos inPos) const
void put_assoc (const void *inKey, const void *inVal, mork_pos inPos) const

Friends

class morkMapIter
class morkHandleFrame

Detailed Description

Definition at line 72 of file morkAtomMap.h.


Constructor & Destructor Documentation

Definition at line 91 of file morkAtomMap.cpp.

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

Here is the call graph for this function:

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

Definition at line 98 of file morkAtomMap.cpp.

: morkProbeMap(ev, inUsage,  ioHeap,
  /*inKeySize*/ sizeof(morkBookAtom*), /*inValSize*/ 0,
  ioSlotHeap, morkAtomAidMap_kStartSlotCount, 
  /*inZeroIsClearKey*/ morkBool_kTrue)
#else /*MORK_ENABLE_PROBE_MAPS*/
: morkMap(ev, inUsage,  ioHeap,
  /*inKeySize*/ sizeof(morkBookAtom*), /*inValSize*/ 0,
  morkAtomAidMap_kStartSlotCount, ioSlotHeap,
  /*inHoldChanges*/ morkBool_kFalse)
#endif /*MORK_ENABLE_PROBE_MAPS*/
{
  if ( ev->Good() )
    mNode_Derived = morkDerived_kAtomAidMap;
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 205 of file morkAtomMap.cpp.

{
  if ( ev->Good() )
  {
#ifdef MORK_ENABLE_PROBE_MAPS
    this->MapAtPut(ev, &ioAtom, /*val*/ (void*) 0, 
      /*key*/ (void*) 0, /*val*/ (void*) 0);
#else /*MORK_ENABLE_PROBE_MAPS*/
    this->Put(ev, &ioAtom, /*val*/ (void*) 0, 
      /*key*/ (void*) 0, /*val*/ (void*) 0, (mork_change**) 0);
#endif /*MORK_ENABLE_PROBE_MAPS*/
  }
  return ev->Good();
}

Here is the call graph for this function:

Here is the caller 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:

void * morkMap::alloc ( morkEnv ev,
mork_size  inSize 
) [protected, inherited]

Definition at line 347 of file morkMap.cpp.

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

  return (void*) 0;
}

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 * morkMap::clear_alloc ( morkEnv ev,
mork_size  inSize 
) [protected, inherited]

Definition at line 328 of file morkMap.cpp.

{
  void* p = 0;
  nsIMdbHeap* heap = mMap_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 morkMap::clear_map ( morkEnv ev,
nsIMdbHeap ioHeap 
) [protected, inherited]

Definition at line 172 of file morkMap.cpp.

{
  mMap_Tag = 0;
  mMap_Seed = 0;
  mMap_Slots = 0;
  mMap_Fill = 0;
  mMap_Keys = 0;
  mMap_Vals = 0;
  mMap_Assocs = 0;
  mMap_Changes = 0;
  mMap_Buckets = 0;
  mMap_FreeList = 0;
  MORK_MEMSET(&mMap_Form, 0, sizeof(morkMapForm));
  
  mMap_Heap = 0;
  if ( ioSlotHeap )
  {
    nsIMdbHeap_SlotStrongHeap(ioSlotHeap, ev, &mMap_Heap);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 117 of file morkAtomMap.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
#ifdef MORK_ENABLE_PROBE_MAPS
      this->CloseProbeMap(ev);
#else /*MORK_ENABLE_PROBE_MAPS*/
      this->CloseMap(ev);
#endif /*MORK_ENABLE_PROBE_MAPS*/
      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 morkMap::CloseMap ( morkEnv ev) [inherited]

Definition at line 126 of file morkMap.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      nsIMdbHeap* heap = mMap_Heap;
      if ( heap ) /* need to free the arrays? */
      {
        nsIMdbEnv* menv = ev->AsMdbEnv();
        
        if ( mMap_Keys )
          heap->Free(menv, mMap_Keys);
          
        if ( mMap_Vals )
          heap->Free(menv, mMap_Vals);
          
        if ( mMap_Assocs )
          heap->Free(menv, mMap_Assocs);
          
        if ( mMap_Buckets )
          heap->Free(menv, mMap_Buckets);
          
        if ( mMap_Changes )
          heap->Free(menv, mMap_Changes);
      }
      mMap_Keys = 0;
      mMap_Vals = 0;
      mMap_Buckets = 0;
      mMap_Assocs = 0;
      mMap_Changes = 0;
      mMap_FreeList = 0;
      MORK_MEMSET(&mMap_Form, 0, sizeof(morkMapForm));
      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 morkMap.

Definition at line 80 of file morkAtomMap.cpp.

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

Here is the call graph for this function:

Here is the caller 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:

mork_bool morkMap::Cut ( morkEnv ev,
const void inKey,
void outKey,
void outVal,
mork_change **  outChange 
) [inherited]

Definition at line 644 of file morkMap.cpp.

{
  mork_bool outCut = morkBool_kFalse;
  
  if ( this->GoodMap() ) /* looks good? */
  {
    mork_u4 hash = this->Hash(ev, inKey);
    morkAssoc** ref = this->find(ev, inKey, hash);
    if ( ref ) /* found an assoc for key? */
    {
      outCut = morkBool_kTrue;
      morkAssoc* assoc = *ref;
      mork_pos i = assoc - mMap_Assocs; /* index of assoc */
      if ( outKey || outVal )
        this->get_assoc(outKey, outVal, i);

      *ref = assoc->mAssoc_Next; /* unlink the found assoc */
      this->push_free_assoc(assoc); /* and put it in free list */

      if ( outChange )
      {
        if ( mMap_Changes )
          *outChange = mMap_Changes + i;
        else
          *outChange = this->FormDummyChange();
      }
      
      ++mMap_Seed; /* note the map has changed */
      if ( mMap_Fill ) /* the count shows nonzero members? */
        --mMap_Fill; /* one less member in the collection */
      else
        this->NewSlotsUnderflowWarning(ev);
    }
  }
  else this->NewBadMapError(ev);
  
  return outCut;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_num morkMap::CutAll ( morkEnv ev) [inherited]

Definition at line 616 of file morkMap.cpp.

{
  mork_num outCutAll = 0;
  
  if ( this->GoodMap() ) /* map looks good? */
  {
    mork_num slots = mMap_Slots;
    morkAssoc* before = mMap_Assocs - 1; /* before first member */
    morkAssoc* assoc = before + slots; /* the very last member */

    ++mMap_Seed; /* note the map is changed */

    /* make the assoc array a linked list headed by first & tailed by last: */
    assoc->mAssoc_Next = 0; /* null terminate the new free list */
    while ( --assoc > before ) /* another assoc to link into the list? */
      assoc->mAssoc_Next = assoc + 1;
    mMap_FreeList = mMap_Assocs; /* all are free */

    outCutAll = mMap_Fill; /* we'll cut all of them of course */

    mMap_Fill = 0; /* the map is completely empty */
  }
  else this->NewBadMapError(ev);
  
  return outCutAll;
}

Here is the call graph for this function:

Definition at line 221 of file morkAtomMap.cpp.

{
  morkBookAtom* oldKey = 0;
  
#ifdef MORK_ENABLE_PROBE_MAPS
  MORK_USED_1(inAtom);
  morkProbeMap::ProbeMapCutError(ev);
#else /*MORK_ENABLE_PROBE_MAPS*/
  this->Cut(ev, &inAtom, &oldKey, /*val*/ (void*) 0,
    (mork_change**) 0);
#endif /*MORK_ENABLE_PROBE_MAPS*/
    
  return oldKey;
}

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_bool morkAtomAidMap::Equal ( morkEnv ev,
const void inKeyA,
const void inKeyB 
) const [virtual]

Implements morkMap.

Definition at line 186 of file morkAtomMap.cpp.

  {
    MORK_USED_1(ev);
    return (*(const morkBookAtom**) inKeyA)->EqualAid(
      *(const morkBookAtom**) inKeyB);
  }
morkAssoc ** morkMap::find ( morkEnv ev,
const void inKey,
mork_u4  inHash 
) const [protected, inherited]

Definition at line 257 of file morkMap.cpp.

{
  mork_u1* keys = mMap_Keys;
  mork_num keySize = this->FormKeySize();
  // morkMap_mEqual equal = this->FormEqual();
  
  morkAssoc** ref = mMap_Buckets + (inHash % mMap_Slots);
  morkAssoc* assoc = *ref;
  while ( assoc ) /* look at another assoc in the bucket? */
  {
    mork_pos i = assoc - mMap_Assocs; /* index of this assoc */
    if ( this->Equal(ev, keys + (i * keySize), inKey) ) /* found? */
      return ref;
      
    ref = &assoc->mAssoc_Next; /* consider next assoc slot in bucket */
    assoc = *ref; /* if this is null, then we are done */
  }
  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_change* morkMap::FormDummyChange ( ) [inline, inherited]

Definition at line 323 of file morkMap.h.

Here is the caller graph for this function:

mork_bool morkMap::FormHoldChanges ( ) const [inline, inherited]

Definition at line 320 of file morkMap.h.

Here is the caller graph for this function:

mork_bool morkMap::FormKeyIsIP ( ) const [inline, inherited]

Definition at line 317 of file morkMap.h.

Here is the caller graph for this function:

mork_size morkMap::FormKeySize ( ) const [inline, inherited]

Definition at line 314 of file morkMap.h.

Here is the caller graph for this function:

mork_bool morkMap::FormValIsIP ( ) const [inline, inherited]

Definition at line 318 of file morkMap.h.

Here is the caller graph for this function:

mork_size morkMap::FormValSize ( ) const [inline, inherited]

Definition at line 315 of file morkMap.h.

Here is the caller graph for this function:

mork_bool morkMap::Get ( morkEnv ev,
const void inKey,
void outKey,
void outVal,
mork_change **  outChange 
) [inherited]

Definition at line 685 of file morkMap.cpp.

{
  mork_bool outGet = morkBool_kFalse;
  
  if ( this->GoodMap() ) /* looks good? */
  {
    mork_u4 hash = this->Hash(ev, inKey);
    morkAssoc** ref = this->find(ev, inKey, hash);
    if ( ref ) /* found an assoc for inKey? */
    {
      mork_pos i = (*ref) - mMap_Assocs; /* index of assoc */
      outGet = morkBool_kTrue;
      this->get_assoc(outKey, outVal, i);
      if ( outChange )
      {
        if ( mMap_Changes )
          *outChange = mMap_Changes + i;
        else
          *outChange = this->FormDummyChange();
      }
    }
  }
  else this->NewBadMapError(ev);
  
  return outGet;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkMap::get_assoc ( void outKey,
void outVal,
mork_pos  inPos 
) const [protected, inherited]

Definition at line 280 of file morkMap.cpp.

{
  mork_num valSize = this->FormValSize();
  if ( valSize && outVal ) /* map holds values? caller wants the value? */
  {
    const mork_u1* value = mMap_Vals + (valSize * inPos);
    if ( valSize == sizeof(mork_ip) && this->FormValIsIP() ) /* ip case? */
      *((mork_ip*) outVal) = *((const mork_ip*) value);
    else
      MORK_MEMCPY(outVal, value, valSize);
  }
  if ( outKey ) /* caller wants the key? */
  {
    mork_num keySize = this->FormKeySize();
    const mork_u1* key = mMap_Keys + (keySize * inPos);
    if ( keySize == sizeof(mork_ip) && this->FormKeyIsIP() ) /* ip case? */
      *((mork_ip*) outKey) = *((const mork_ip*) key);
    else
      MORK_MEMCPY(outKey, key, keySize);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 251 of file morkAtomMap.cpp.

{
  morkWeeBookAtom weeAtom(inAid);
  morkBookAtom* key = &weeAtom; // we need a pointer
  morkBookAtom* oldKey = 0; // old key in the map

#ifdef MORK_ENABLE_PROBE_MAPS
  this->MapAt(ev, &key, &oldKey, /*val*/ (void*) 0);
#else /*MORK_ENABLE_PROBE_MAPS*/
  this->Get(ev, &key, &oldKey, /*val*/ (void*) 0, (mork_change**) 0);
#endif /*MORK_ENABLE_PROBE_MAPS*/
  
  return oldKey;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 237 of file morkAtomMap.cpp.

{
  morkBookAtom* key = 0; // old val in the map

#ifdef MORK_ENABLE_PROBE_MAPS
  this->MapAt(ev, &inAtom, &key, /*val*/ (void*) 0);
#else /*MORK_ENABLE_PROBE_MAPS*/
  this->Get(ev, &inAtom, &key, /*val*/ (void*) 0, (mork_change**) 0);
#endif /*MORK_ENABLE_PROBE_MAPS*/
  
  return key;
}

Here is the call graph for this function:

Here is the caller 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 morkMap::GoodMap ( ) const [inline, inherited]

Definition at line 258 of file morkMap.h.

  { return ( IsNode() && GoodMapTag() ); }

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkMap::GoodMapTag ( ) const [inline, inherited]

Definition at line 257 of file morkMap.h.

{ return mMap_Tag == morkMap_kTag; }

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 morkMap::grow ( morkEnv ev) [protected, inherited]

Definition at line 514 of file morkMap.cpp.

{
  if ( mMap_Heap ) /* can we grow the map? */
  {
    mork_num newSlots = (mMap_Slots * 2); /* +100% */
    morkHashArrays old; /* a place to temporarily hold all the old arrays */
    if ( this->new_arrays(ev, &old, newSlots) ) /* have more? */
    {
      // morkMap_mHash hash = this->FormHash(); /* for terse loop use */
      
      /* figure out the bulk volume sizes of old keys and values to move: */
      mork_num oldSlots = old.mHashArrays_Slots; /* number of old assocs */
      mork_num keyBulk = oldSlots * this->FormKeySize(); /* key volume */
      mork_num valBulk = oldSlots * this->FormValSize(); /* values */
      
      /* convenient variables for new arrays that need to be rehashed: */
      morkAssoc** newBuckets = mMap_Buckets; /* new all zeroes */
      morkAssoc* newAssocs = mMap_Assocs; /* hash into buckets */
      morkAssoc* newFreeList = newAssocs + oldSlots; /* new room is free */
      mork_u1* key = mMap_Keys; /* the first key to rehash */
      --newAssocs; /* back up one before preincrement used in while loop */
      
      /* move all old keys and values to the new arrays: */
      MORK_MEMCPY(mMap_Keys, old.mHashArrays_Keys, keyBulk);
      if ( valBulk ) /* are values nonzero sized? */
        MORK_MEMCPY(mMap_Vals, old.mHashArrays_Vals, valBulk);
        
      mMap_FreeList = newFreeList; /* remaining assocs are free */
      
      while ( ++newAssocs < newFreeList ) /* rehash another old assoc? */
      {
        morkAssoc** top = newBuckets + (this->Hash(ev, key) % newSlots);
        key += this->FormKeySize(); /* the next key to rehash */
        newAssocs->mAssoc_Next = *top; /* link to prev bucket top */
        *top = newAssocs; /* push assoc on top of bucket */
      }
      ++mMap_Seed; /* note the map has changed */
      old.finalize(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:

mork_u4 morkAtomAidMap::Hash ( morkEnv ev,
const void inKey 
) const [virtual]

Implements morkMap.

Definition at line 195 of file morkAtomMap.cpp.

  {
    MORK_USED_1(ev);
    return (*(const morkBookAtom**) inKey)->HashAid();
  }
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 morkMap::InitMap ( morkEnv ev,
mork_size  inSlots 
) [inherited]

Definition at line 238 of file morkMap.cpp.

{
  if ( ev->Good() )
  {
    morkHashArrays old;
    // MORK_MEMCPY(&mMap_Form, &inForm, sizeof(morkMapForm));
    if ( inSlots < 3 ) /* requested capacity absurdly small? */
      inSlots = 3; /* bump it up to a minimum practical level */
    else if ( inSlots > (128 * 1024) ) /* requested slots absurdly big? */
      inSlots = (128 * 1024); /* decrease it to a maximum practical level */
      
    if ( this->new_arrays(ev, &old, inSlots) )
      mMap_Tag = morkMap_kTag;

    MORK_MEMSET(&old, 0, sizeof(morkHashArrays)); // do NOT finalize
  }
}

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 86 of file morkAtomMap.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 morkMap::IsMap ( ) const [inline, inherited]

Definition at line 241 of file morkMap.h.

  { return IsNode() && mNode_Derived == morkDerived_kMap; }

Here is the call graph for this function:

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 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_fill morkMap::MapFill ( ) const [inline, inherited]

Definition at line 226 of file morkMap.h.

{ return mMap_Fill; }

Here is the caller 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 morkMap::new_arrays ( morkEnv ev,
morkHashArrays old,
mork_num  inSlots 
) [protected, inherited]

Definition at line 423 of file morkMap.cpp.

{
  mork_bool outNew = morkBool_kFalse;
    
  /* see if we can allocate all the new arrays before we go any further: */
  morkAssoc** newBuckets = this->new_buckets(ev, inSlots);
  morkAssoc* newAssocs = this->new_assocs(ev, inSlots);
  mork_u1* newKeys = this->new_keys(ev, inSlots);
  mork_u1* newValues = this->new_values(ev, inSlots);
  mork_change* newChanges = this->new_changes(ev, inSlots);
  
  /* it is okay for newChanges to be null when changes are not held: */
  mork_bool okayChanges = ( newChanges || !this->FormHoldChanges() );
  
  /* it is okay for newValues to be null when values are zero sized: */
  mork_bool okayValues = ( newValues || !this->FormValSize() );
  
  if ( newBuckets && newAssocs && newKeys && okayChanges && okayValues )
  {
    outNew = morkBool_kTrue; /* yes, we created all the arrays we need */

    /* init the old hashArrays with slots from this hash table: */
    old->mHashArrays_Heap = mMap_Heap;
    
    old->mHashArrays_Slots = mMap_Slots;
    old->mHashArrays_Keys = mMap_Keys;
    old->mHashArrays_Vals = mMap_Vals;
    old->mHashArrays_Assocs = mMap_Assocs;
    old->mHashArrays_Buckets = mMap_Buckets;
    old->mHashArrays_Changes = mMap_Changes;
    
    /* now replace all our array slots with the new structures: */
    ++mMap_Seed; /* note the map is now changed */
    mMap_Keys = newKeys;
    mMap_Vals = newValues;
    mMap_Buckets = newBuckets;
    mMap_Assocs = newAssocs;
    mMap_FreeList = newAssocs; /* all are free to start with */
    mMap_Changes = newChanges;
    mMap_Slots = inSlots;
  }
  else /* free the partial set of arrays that were actually allocated */
  {
    nsIMdbEnv* menv = ev->AsMdbEnv();
    nsIMdbHeap* heap = mMap_Heap;
    if ( newBuckets )
      heap->Free(menv, newBuckets);
    if ( newAssocs )
      heap->Free(menv, newAssocs);
    if ( newKeys )
      heap->Free(menv, newKeys);
    if ( newValues )
      heap->Free(menv, newValues);
    if ( newChanges )
      heap->Free(menv, newChanges);
    
    MORK_MEMSET(old, 0, sizeof(morkHashArrays));
  }
  
  return outNew;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkAssoc * morkMap::new_assocs ( morkEnv ev,
mork_num  inSlots 
) [protected, inherited]

Definition at line 408 of file morkMap.cpp.

{
  mork_num size = inSlots * sizeof(morkAssoc);
  morkAssoc* assocs = (morkAssoc*) this->alloc(ev, size);
  if ( assocs ) /* able to allocate the array? */
  {
    morkAssoc* a = assocs + (inSlots - 1); /* the last array element */
    a->mAssoc_Next = 0; /* terminate tail element of the list with null */
    while ( --a >= assocs ) /* another assoc to link into the list? */
      a->mAssoc_Next = a + 1; /* each points to the following assoc */
  }
  return assocs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkAssoc ** morkMap::new_buckets ( morkEnv ev,
mork_num  inSlots 
) [protected, inherited]

Definition at line 397 of file morkMap.cpp.

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

Here is the call graph for this function:

Here is the caller graph for this function:

mork_change * morkMap::new_changes ( morkEnv ev,
mork_num  inSlots 
) [protected, inherited]

Definition at line 385 of file morkMap.cpp.

{
  mork_change* changes = 0;
  mork_num size = inSlots * sizeof(mork_change);
  if ( size && mMap_Form.mMapForm_HoldChanges )
    changes = (mork_change*) this->clear_alloc(ev, size);
  return changes;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_u1 * morkMap::new_keys ( morkEnv ev,
mork_num  inSlots 
) [protected, inherited]

Definition at line 365 of file morkMap.cpp.

{
  mork_num size = inSlots * this->FormKeySize();
  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 * morkMap::new_values ( morkEnv ev,
mork_num  inSlots 
) [protected, inherited]

Definition at line 375 of file morkMap.cpp.

{
  mork_u1* values = 0;
  mork_num size = inSlots * this->FormValSize();
  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:

void morkMap::NewBadMapError ( morkEnv ev) [inherited]

Definition at line 226 of file morkMap.cpp.

{
  ev->NewError("bad morkMap tag");
  if ( !this )
    ev->NewError("nil morkMap instance");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 221 of file morkMap.cpp.

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

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 233 of file morkMap.cpp.

{
  ev->NewWarning("member count underflow");
}

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:

morkAssoc* morkMap::pop_free_assoc ( ) [inline, protected, inherited]

Definition at line 280 of file morkMap.h.

  {
    morkAssoc* assoc = mMap_FreeList;
    if ( assoc )
      mMap_FreeList = assoc->mAssoc_Next;
    return assoc;
  }

Here is the caller graph for this function:

void morkMap::push_free_assoc ( morkAssoc ioAssoc) [inline, protected, inherited]

Definition at line 274 of file morkMap.h.

  {
    ioAssoc->mAssoc_Next = mMap_FreeList;
    mMap_FreeList = ioAssoc;
  }

Here is the caller graph for this function:

mork_bool morkMap::Put ( morkEnv ev,
const void inKey,
const void inVal,
void outKey,
void outVal,
mork_change **  outChange 
) [inherited]

Definition at line 561 of file morkMap.cpp.

{
  mork_bool outPut = morkBool_kFalse;
  
  if ( this->GoodMap() ) /* looks good? */
  {
    mork_u4 hash = this->Hash(ev, inKey);
    morkAssoc** ref = this->find(ev, inKey, hash);
    if ( ref ) /* assoc was found? reuse an existing assoc slot? */
    {
      outPut = morkBool_kTrue; /* inKey was indeed already inside the map */
    }
    else /* assoc not found -- need to allocate a new assoc slot */
    {
      morkAssoc* assoc = this->pop_free_assoc();
      if ( !assoc ) /* no slots remaining in free list? must grow map? */
      {
        if ( this->grow(ev) ) /* successfully made map larger? */
          assoc = this->pop_free_assoc();
      }
      if ( assoc ) /* allocated new assoc without error? */
      {
        ref = mMap_Buckets + (hash % mMap_Slots);
        assoc->mAssoc_Next = *ref; /* link to prev bucket top */
        *ref = assoc; /* push assoc on top of bucket */
          
        ++mMap_Fill; /* one more member in the collection */
        ++mMap_Seed; /* note the map has changed */
      }
    }
    if ( ref ) /* did not have an error during possible growth? */
    {
      mork_pos i = (*ref) - mMap_Assocs; /* index of assoc */
      if ( outPut && (outKey || outVal) ) /* copy old before cobbering? */
        this->get_assoc(outKey, outVal, i);

      this->put_assoc(inKey, inVal, i);
      ++mMap_Seed; /* note the map has changed */
      
      if ( outChange )
      {
        if ( mMap_Changes )
          *outChange = mMap_Changes + i;
        else
          *outChange = this->FormDummyChange();
      }
    }
  }
  else this->NewBadMapError(ev);
  
  return outPut;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkMap::put_assoc ( const void inKey,
const void inVal,
mork_pos  inPos 
) const [protected, inherited]

Definition at line 305 of file morkMap.cpp.

{
  mork_num valSize = this->FormValSize();
  if ( valSize && inVal ) /* map holds values? caller sends a value? */
  {
    mork_u1* value = mMap_Vals + (valSize * inPos);
    if ( valSize == sizeof(mork_ip) && this->FormValIsIP() ) /* ip case? */
      *((mork_ip*) value) = *((const mork_ip*) inVal);
    else
      MORK_MEMCPY(value, inVal, valSize);
  }
  if ( inKey ) /* caller sends a key? */
  {
    mork_num keySize = this->FormKeySize();
    mork_u1* key = mMap_Keys + (keySize * inPos);
    if ( keySize == sizeof(mork_ip) && this->FormKeyIsIP() ) /* ip case? */
      *((mork_ip*) key) = *((const mork_ip*) inKey);
    else
      MORK_MEMCPY(key, inKey, keySize);
  }
}

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 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 morkAtomAidMap::SlotStrongAtomAidMap ( morkAtomAidMap me,
morkEnv ev,
morkAtomAidMap **  ioSlot 
) [inline, static]

Definition at line 147 of file morkAtomMap.h.

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

Here is the call graph for this function:

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

Definition at line 349 of file morkMap.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 morkAtomAidMap::SlotWeakAtomAidMap ( morkAtomAidMap me,
morkEnv ev,
morkAtomAidMap **  ioSlot 
) [inline, static]

Definition at line 143 of file morkAtomMap.h.

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

Here is the call graph for this function:

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

Definition at line 345 of file morkMap.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 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 morkMapIter [friend, inherited]

Definition at line 268 of file morkMap.h.


Member Data Documentation

Definition at line 204 of file morkMap.h.

Definition at line 215 of file morkMap.h.

Definition at line 208 of file morkMap.h.

Definition at line 187 of file morkMap.h.

Definition at line 174 of file morkMap.h.

Definition at line 223 of file morkMap.h.

Definition at line 168 of file morkMap.h.

Definition at line 194 of file morkMap.h.

Definition at line 179 of file morkMap.h.

Definition at line 186 of file morkMap.h.

Definition at line 169 of file morkMap.h.

Definition at line 195 of file morkMap.h.

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.


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