Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
weakpointer.h File Reference

Go to the source code of this file.

Classes

class  WeakPointer< T >
class  CleanUp< T, Data >
class  CleanUp< T, Data >::Queue

Functions

void_WeakPointer_New (void *t)
void_WeakPointer_Pointer (void *wp)
int _WeakPointer_Equal (void *wp1, void *wp2)
int _WeakPointer_Hash (void *wp)
void _CleanUp_Set (void *t, void(*c)(void *d, void *t), void *d)
void _CleanUp_Call (void *t)
void_CleanUp_Queue_NewHead ()
void _CleanUp_Queue_Set (void *h, void *t)
int _CleanUp_Queue_Call (void *h)

Function Documentation

Definition at line 447 of file gcc_support.c.

{
      /* ? Aren't we supposed to deactivate weak pointers to t too? 
         Why? */
    void* base = GC_base( t );
    void* d;
    GC_finalization_proc f;

    GC_REGISTER_FINALIZER( base, 0, 0, &f, &d );
    f( base, d );}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 501 of file gcc_support.c.

{
    QueueElem* head = (QueueElem*) h;
    QueueElem* q = head->next;

    if (q == 0) {
        return 0;}
    else {
        head->next = q->next;
        q->next = 0;
        if (q->f != 0) q->f( q->o, q->d );
        return 1;}}

Here is the caller graph for this function:

Definition at line 468 of file gcc_support.c.

{
    return GC_MALLOC( sizeof( QueueElem ) );}

Here is the caller graph for this function:

void _CleanUp_Queue_Set ( void h,
void t 
)

Definition at line 485 of file gcc_support.c.

{
    QueueElem* head = (QueueElem*) h;
    void* base = GC_base( t );
    void* d;
    GC_finalization_proc f;
    QueueElem* q = (QueueElem*) GC_MALLOC( sizeof( QueueElem ) );
     
    GC_REGISTER_FINALIZER( base, _CleanUp_Queue_Enqueue, q, &f, &d );
    q->f = f;
    q->d = d;
    q->next = head;}

Here is the call graph for this function:

Here is the caller graph for this function:

void _CleanUp_Set ( void t,
void(*)(void *d, void *t c,
void d 
)
int _WeakPointer_Equal ( void wp1,
void wp2 
)

Definition at line 341 of file gcc_support.c.

{
    if (t == 0) {
        return 0;}
    else {
        void* base = GC_base( t );
        WeakPointer* wp = 
            (WeakPointer*) GC_MALLOC_ATOMIC( sizeof( WeakPointer ) );
        Descriptor* desc = DESCRIPTOR( base );

        wp->pointer = t;
        desc->has_weak_pointers = 1;
        GC_general_register_disappearing_link( &wp->pointer, base );
        return wp;}}

Here is the call graph for this function:

Here is the caller graph for this function: