Commit 78c72b5a authored by Pekka Pessi's avatar Pekka Pessi

su_alloc.h, su_alloc.c: added su_home_refcount().

darcs-hash:20061016155752-65a35-3d22febef06c90f77c3e799b0d4eb80547928098.gz
parent 7bcc5540
......@@ -67,6 +67,8 @@ SU_DLL void *su_home_new(isize_t size)
SU_DLL void *su_home_ref(su_home_t const *);
SU_DLL int su_home_unref(su_home_t *);
SU_DLL size_t su_home_refcount(su_home_t *home);
SU_DLL int su_home_destructor(su_home_t *, void (*)(void *));
SU_DLL int su_home_desctructor(su_home_t *, void (*)(void *));
......
......@@ -652,6 +652,22 @@ int su_home_unref(su_home_t *home)
}
}
/** Return reference count of home. */
size_t su_home_refcount(su_home_t *home)
{
size_t count = 0;
if (home) {
su_block_t *sub = MEMLOCK(home);
if (sub)
count = sub->sub_ref;
UNLOCK(home);
}
return count;
}
/**Clone a su_home_t object.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment