misc/alloc-monitor.c
static void delete(void *ptr) {
    struct list *l, *temp;

    assert(exists(ptr));
    LOCK(heap_pointers_lock);
    for (l = heap_pointers, temp = NULL; l; temp = l, l = l->next) {
        if (l->value == ptr) {
            /* We've found the element we're after. */
            if (temp) temp->next = l->next;
            else      heap_pointers = l->next;
            assert(real_free);
            real_free(l);
            UNLOCK(heap_pointers_lock);
            return;
        }
    }
    /* We should never reach this point. */
    DIE("Alloc Monitor: Failed to find pointer while attempting to delete "
        "(framework failure?).\n");
}
/* Remove a pointer from the list of allocated pointers. */
Remove a pointer from the list of allocated pointers.
Remove a pointer from the list of allocated pointers .
static void delete(void *ptr) {
    struct list *l, *temp;
    assert(exists(ptr));
    LOCK(heap_pointers_lock);
    for (l = heap_pointers, temp = NULL; l; temp = l, l = l->next) {
        if (l->value == ptr) {
            if (temp) temp->next = l->next;
            else      heap_pointers = l->next;
            assert(real_free);
            real_free(l);
            UNLOCK(heap_pointers_lock);
            return;
        }
    }
    DIE("Alloc Monitor: Failed to find pointer while attempting to delete "
        "(framework failure?).\n");
}
static void delete ( void * ptr ) { struct list * l , * temp ; assert ( exists ( ptr ) ) ; LOCK ( heap_pointers_lock ) ; for ( l = heap_pointers , temp = NULL ; l ; temp = l , l = l -> next ) { if ( l -> value == ptr ) { if ( temp ) temp -> next = l -> next ; else heap_pointers = l -> next ; assert ( real_free ) ; real_free ( l ) ; UNLOCK ( heap_pointers_lock ) ; return ; } } DIE ( " " " \n " ) ; }
Remove a pointer from the list of allocated pointers.
Remove a pointer from the list of allocated pointers .
/* We've found the element we're after. */ /* We should never reach this point. */