コード例 #1
0
static inline void instance_destroy(fcs_dbm_solver_instance_t *instance)
{
    fcs_dbm_collection_by_depth_t *coll;

    fc_solve_compact_allocator_finish(&(instance->fcc_entry_points_allocator));
    fc_solve_meta_compact_allocator_finish(&(instance->fcc_meta_alloc));
    {
        coll = &(instance->coll);
        fcs_depth_multi_queue__destroy(&(coll->depth_queue));
#ifndef FCS_DBM_USE_OFFLOADING_QUEUE
        fc_solve_meta_compact_allocator_finish(&(coll->queue_meta_alloc));
#endif
        DESTROY_CACHE(coll);
    }
    fcs_lock_destroy(&instance->common.storage_lock);
    fcs_lock_destroy(&instance->global_lock);
    fcs_lock_destroy(&instance->fcc_entry_points_lock);
    fcs_lock_destroy(&instance->fcc_exit_points_output_lock);
    fcs_lock_destroy(&instance->output_lock);
}
コード例 #2
0
ファイル: split_fcc_solver.c プロジェクト: shlomif/fc-solve
static GCC_INLINE void release_starting_state_specific_instance_resources(
    fcs_dbm_solver_instance_t * const instance
)
{
    fcs_dbm_collection_by_depth_t * coll = &(instance->coll);

    /* TODO : Implement. */
    DESTROY_CACHE(coll);
    /* That is important to avoid stale nodes. */
    instance->common.tree_recycle_bin = NULL;

#ifndef FCS_DBM_WITHOUT_CACHES
#ifndef FCS_DBM_CACHE_ONLY
        pre_cache_init (&(coll->pre_cache), &(coll->meta_alloc));
#endif
        coll->pre_cache_max_count = pre_cache_max_count;
        cache_init (&(coll->cache), pre_cache_max_count+caches_delta, &(coll->meta_alloc));
#endif
#ifndef FCS_DBM_CACHE_ONLY
        fc_solve_dbm_store_init(&(coll->store), instance->dbm_store_path, &(instance->common.tree_recycle_bin));
#endif
}