int cilk_fiber::remove_reference_from_thread()
{
    int ref_count = dec_ref_count();
    if (ref_count == 0) {
        cilk_fiber_sysdep* self = this->sysdep();
        self->~cilk_fiber_sysdep();
        __cilkrts_free(self);
    }
    return ref_count;
}
Esempio n. 2
0
void frame_add(Hash *frame, char *key, boxed_value *value){
    if (hash_contains(frame, key)){
        boxed_value *current_value = hash_value(frame, key);
        if (value == current_value)
            return;
        else
            dec_ref_count(current_value);
    }
    inc_ref_count(value);
    hash_add(frame, strdup(key), value);
}
Esempio n. 3
0
/***********************************************************************
 *           SelectObject    (GDI32.@)
 */
HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ handle )
{
    HGDIOBJ ret = 0;
    DC * dc = DC_GetDCUpdate( hdc );
    if (!dc) return 0;
    TRACE("hdc=%04x %04x\n", hdc, handle );

    /* Fonts get a rather different treatment so we'll handle them
       separately */
    if(GetObjectType(handle) == OBJ_FONT)
        ret = FONT_SelectObject(dc, handle);
    else if (dc->funcs->pSelectObject)
        ret = dc->funcs->pSelectObject( dc, handle );
    GDI_ReleaseObj( hdc );

    if (ret && ret != handle)
    {
        inc_ref_count( handle );
        dec_ref_count( ret );
    }
    return ret;
}
Esempio n. 4
0
void free_key_value_pair(KeyValuePair *kv){
    my_free(kv->key);
    dec_ref_count(kv->value);
    my_free(kv);
}