Add debug functions
This commit is contained in:
		| @ -454,6 +454,24 @@ static inline bool refcount_remove_destructor(void *obj, void *key) { | ||||
|                                               key); | ||||
| } | ||||
|  | ||||
| // Debug Functions | ||||
|  | ||||
| uint64_t refcount_debug_context_count_object(const RefcountContext *ctx, | ||||
|                                              void *obj, void *target); | ||||
|  | ||||
| /** | ||||
|  * Same as #refcount_debug_context_count_object, but only operates on the global | ||||
|  * context. | ||||
|  * @param obj The root object | ||||
|  * @param target The object to look for | ||||
|  * @return The number of times the target appeared in the reference tree of the | ||||
|  * root | ||||
|  */ | ||||
| static inline uint64_t refcount_debug_count_object(void *obj, void *target) { | ||||
|     return refcount_debug_context_count_object(refcount_default_context, obj, | ||||
|                                                target); | ||||
| } | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| } | ||||
| #endif | ||||
|  | ||||
		Reference in New Issue
	
	Block a user