Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

void kldrDyldModDeref ( PKLDRDYLDMOD  pMod  ) 

Dereference a module.

Parameters:
pMod 

Definition at line 477 of file kLdrDyldMod.c.

References KLDRDYLDMOD::cDepRefs, KLDRDYLDMOD::cDynRefs, KLDRDYLDMOD::cRefs, KLDRDYLDMOD::enmState, KLDRDYLDMOD_ASSERT, KLDRSTATE_DESTROYED, KLDRSTATE_END, KLDRSTATE_INVALID, KLDRDYLDMOD::u32MagicHead, and KLDRDYLDMOD::u32MagicTail.

Referenced by kldrDyldDoLoad2(), kldrDyldDoModuleTerminationAndGarabageCollection(), and kldrDyldStackDropFrame().

{
    /* validate input */
    KLDRDYLDMOD_ASSERT(pMod->cRefs > 0);
    KLDRDYLDMOD_ASSERT(pMod->cRefs >= pMod->cDepRefs + pMod->cDynRefs);
    KLDRDYLDMOD_ASSERT(pMod->enmState > KLDRSTATE_INVALID && pMod->enmState <= KLDRSTATE_END);

    /* decrement. */
    if (pMod->cRefs > 0)
        pMod->cRefs--;

    /* execute delayed freeing. */
    if (    pMod->enmState == KLDRSTATE_DESTROYED
        &&  !pMod->cRefs)
    {
        pMod->u32MagicHead = 1;
        pMod->u32MagicTail = 2;
        kHlpFree(pMod);
    }
}


Generated by  Doxygen 1.6.0   Back to index