Add a null reference that doesn't call malloc.
This commit is contained in:
@@ -57,6 +57,12 @@ typedef struct libab_ref_count_s libab_ref_count;
|
||||
* @return the result of the construction of the reference.
|
||||
*/
|
||||
libab_result libab_ref_new(libab_ref* ref, void* data, void (*free_func)(void* data));
|
||||
/**
|
||||
* Creates a reference to NULL. This does
|
||||
* not require a memory allocation.
|
||||
* @param ref the reference to initialize with null.
|
||||
*/
|
||||
void libab_ref_null(libab_ref* ref);
|
||||
/**
|
||||
* Turns the given reference into a weak reference,
|
||||
* making it not keep the data allocated.
|
||||
|
||||
Reference in New Issue
Block a user