コード例 #1
0
void armsoc_bo_set_drawable(struct armsoc_bo *bo, DrawablePtr pDraw)
{
	struct armsoc_bo *replaced;
	bo->pDraw = pDraw;
	HASH_REPLACE_PTR(hash, pDraw, bo, replaced);
	if (replaced)
		replaced->pDraw = NULL;
}
コード例 #2
0
ファイル: debug_alloc.c プロジェクト: jdinan/openshmem
void
debug_alloc_replace (void *a, size_t s)
{
#if 1
    /*
     * TODO: could be a typo in HASH_REPLACE_PTR
     * DONE: now fixed in uthash >= 1.9.9 (TC contributed fix)
     */
    alloc_table_t *at = debug_alloc_new (a, s);
    alloc_table_t *replaced_stub;
    HASH_REPLACE_PTR (atp, addr, at, replaced_stub);
#else
    debug_alloc_del (a);
    debug_alloc_add (a, s);
#endif
}