Example #1
0
/*---------------------------------------------------------------------*
 *                 Exported Function Implementation                    *
 *---------------------------------------------------------------------*/
void
table_thread_init(void *drcontext, umbra_info_t *info)
{
    init_bb_table(drcontext, info);
    init_edge_table(drcontext, info);
    init_ref_table(drcontext, info);
    init_func_table(drcontext, info);
    init_ref_cache_table(drcontext, info);
    init_code_hash(drcontext, info);
    init_bytes_table(drcontext, info);
}
Example #2
0
unsigned int
delref(const void *p)
{
    int index;

    if (!init)
        init_ref_table();

    if (p == 0)
        panic("decreasing ref count of 0x0");

    index = key(p);
    return ll_delete_value(&(ref_table[index]), p);
}
Example #3
0
void
addref(const void *p)
{
    int index;

    if (!init)
        init_ref_table();

    if (p == 0)
        panic("increasing ref count of 0x0");

    index = key(p);
    ll_insert_value(&(ref_table[index]), p);

    if (table_entries > table_size) {
        reftab_entry **new_table;
        table_power++;
        table_size *= 2;
        new_table = mymalloc(table_size * sizeof(reftab_entry *), M_REF_TABLE);
        for (index = 0; index < table_size; index++)
            new_table[index] = 0;
        ref_table = rehash(ref_table, new_table);	/* frees old table */
    }
}