fellow_cache: support freeing an fco embedded in the fdo

parent 0cd1da52
...@@ -1640,12 +1640,12 @@ fellow_cache_obj_free(const struct fellow_cache *fc, ...@@ -1640,12 +1640,12 @@ fellow_cache_obj_free(const struct fellow_cache *fc,
AZ(pthread_mutex_destroy(&fco->mtx)); AZ(pthread_mutex_destroy(&fco->mtx));
AZ(pthread_cond_destroy(&fco->cond)); AZ(pthread_cond_destroy(&fco->cond));
fellow_cache_seg_free(memret, fcs, 0);
if (fco->fco_dowry.bits) if (fco->fco_dowry.bits)
AN(buddy_return_ptr_page(memret, &fco->fco_dowry)); AN(buddy_return_ptr_page(memret, &fco->fco_dowry));
TAKE(mem, fco->fco_mem); TAKE(mem, fco->fco_mem);
assert(mem.ptr == fco); // this frees the fdo, which may contain the fco
fellow_cache_seg_free(memret, fcs, 0);
if (mem.ptr)
AN(buddy_return_ptr_extent(memret, &mem)); AN(buddy_return_ptr_extent(memret, &mem));
buddy_return(memret); buddy_return(memret);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment