]> git.lizzy.rs Git - dragonstd.git/blobdiff - test/test_refcount_map.c
Add key to add functions
[dragonstd.git] / test / test_refcount_map.c
index fc3b5e4596cc63d9a5537380c06a0b26db63b551..6a8c03998220d06cda367bc4c49e3286fd0435b1 100644 (file)
@@ -32,11 +32,6 @@ int cmp_obj(const Refcount *rc, const int *id)
        return ((DataObject *) rc->obj)->id - *id;
 }
 
-int cmp_obj_sym(const Refcount *rc1, const Refcount *rc2)
-{
-       return cmp_obj(rc1, &((DataObject *) rc2->obj)->id);
-}
-
 static void *thread_create(unsigned int *result)
 {
        while (!cancel) {
@@ -45,7 +40,7 @@ static void *thread_create(unsigned int *result)
 
                refcount_ini(&obj->rc, obj, &delete_obj);
 
-               if (map_add(&map, &obj->rc, &cmp_obj_sym, &refcount_inc))
+               if (map_add(&map, &obj->id, &obj->rc, &cmp_obj, &refcount_inc))
                        (*result)++;
 
                refcount_drp(&obj->rc);