Add void_obj option

This commit is contained in:
2025-09-09 15:13:23 -07:00
parent 403618888c
commit 5064f304ca
3 changed files with 10 additions and 7 deletions

View File

@ -51,6 +51,8 @@ typedef void (*refcount_destroy_callback_t)(void *obj, void *user_data);
*/
typedef struct RefcountContext {
size_t entry_offset; //!< Offset to the #RefcountEntry member.
void *void_val; //!< Value returned by #refcount_context_unref when a
//!< reference count falls to 0.
refcount_held_refs_callback_t
held_refs_callback; //!< Callback to list an object's held references.
refcount_destroy_callback_t
@ -75,7 +77,7 @@ typedef struct RefcountContext {
extern RefcountContext *refcount_default_context;
RefcountContext *
refcount_make_context(size_t entry_offset,
refcount_make_context(size_t entry_offset, void *void_val,
refcount_held_refs_callback_t held_refs_callback,
refcount_destroy_callback_t destroy_callback,
void *user_data, const RefcountAllocator *alloc);