Make refcounted returns move consistent.

This commit is contained in:
2018-05-14 18:34:30 -07:00
parent c3f413d087
commit df50579b5c
4 changed files with 13 additions and 18 deletions

View File

@@ -38,11 +38,6 @@ struct libab_ref_trie_s {
* The first node in the trie.
*/
struct libab_ref_trie_node_s* head;
/**
* Reference (initialized to NULL) returned
* if no key is found.
*/
libab_ref null_ref;
};
typedef struct libab_ref_trie_node_s libab_ref_trie_node;
@@ -78,8 +73,8 @@ libab_result libab_ref_trie_put(libab_ref_trie* trie, const char* key,
* @param key the key to look under.
* @return a reference stored under the given key. This can be a NULL reference.
*/
const libab_ref* libab_ref_trie_get(const libab_ref_trie* trie,
const char* key);
void libab_ref_trie_get(const libab_ref_trie* trie,
const char* key, libab_ref* into);
/**
* Releases the trie, decrementing the refcounts of all
* the values stored inside.

View File

@@ -57,9 +57,10 @@ libab_result libab_ref_vec_insert_value(libab_ref_vec* vec, void* data,
* doesn't exist.
* @param vec the vector to get a value from.
* @param index the index to look at.
* @param into the reference to store the result value into.
* @return the reference stored at the given index.
*/
const libab_ref* libab_ref_vec_index(libab_ref_vec* vec, size_t index);
void libab_ref_vec_index(libab_ref_vec* vec, size_t index, libab_ref* into);
/**
* Releases the memory allocated by the vector.
* The references stored in the vector have their refcount decreased.