Finish basic implementation of garbage collection.

This commit is contained in:
2018-08-11 20:01:43 -07:00
parent f4ecb82c46
commit 76ea606099
5 changed files with 68 additions and 16 deletions

View File

@@ -33,6 +33,10 @@ void libab_gc_list_init(libab_gc_list* list);
* @param data the data to pass to the visitor.
*/
void libab_gc_visit_children(struct libab_ref_s* ref, libab_visitor_function_ptr visitor, void* data);
/**
* Applies the given visitor function to this reference.
*/
void libab_gc_visit(struct libab_ref_s* ref, libab_visitor_function_ptr visitor, void* data);
/**
* Adds the given reference to the given garbage collection list,
* and specifies a function used to reach its children.

View File

@@ -0,0 +1,8 @@
#ifndef LIBABACUS_REFCOUNT_INTERNAL_H
#define LIBABACUS_REFCOUNT_INTERNAL_H
#include "refcount.h"
void libab_ref_count_changed(libab_ref_count* count);
#endif