typedef struct ml_gc_object_t
{
- vlc_spinlock_t spin;
bool pool;
uintptr_t refs;
void (*pf_destructor) (struct ml_gc_object_t *);
if( p_gc == NULL )
return;
- vlc_spin_lock (&p_gc->spin);
++p_gc->refs;
- vlc_spin_unlock (&p_gc->spin);
}
/**
if( p_gc == NULL )
return;
- vlc_spin_lock (&p_gc->spin);
refs = --p_gc->refs;
pool = p_gc->pool;
- vlc_spin_unlock (&p_gc->spin);
if( refs == 0 && !pool )
{
- vlc_spin_destroy (&p_gc->spin);
p_gc->pf_destructor (p_gc);
}
}