vec_t* vec_decref (vec_t *vec) { ensure_vec(vec, __func__); if (--vec->ref_count == 0) { vec_empty(vec); arena_free(vecs, vec); vec_count--; vec_destroyed++; vec = NULL; } return vec; }
int list_del(char* base, char* key, int key_len) { int ndel = 0; btree_node* bp = (btree_node*) base; int* i = &bp->cell_list; while(*i != 0) { list_node* np = (list_node*)(base+*i); if(np->key_len == key_len && memcmp(get_key(np), key, key_len) == 0) // match { ndel++; arena_free(base, *i); *i = np->next; } else i = &np->next; } return ndel; }
int uct_destroy() { arena_free(UCT_NODE_ARENA); return 1; }
void kpages_free(void *addr, size_t size) { arena_free(kpages_arena, addr, size); }
void arena_dispose(arena_t *ap){ assert(ap && *ap); arena_free(*ap); free(ap); *ap=NULL; }