Example #1
0
/**
 * @brief Cleanup shared memory resources.
 *
 * @param[in] ni
 */
static void release_shmem_resources(ni_t *ni)
{
    pool_fini(&ni->sbuf_pool);

    if (ni->shmem.comm_pad != MAP_FAILED) {
        munmap(ni->shmem.comm_pad, ni->shmem.comm_pad_size);
        ni->shmem.comm_pad = MAP_FAILED;
    }

    if (ni->shmem.comm_pad_shm_name) {
        /* Destroy the mmaped file so it doesn't pollute.
         * All ranks try it in case rank 0 died. */
        shm_unlink(ni->shmem.comm_pad_shm_name);

        free(ni->shmem.comm_pad_shm_name);
        ni->shmem.comm_pad_shm_name = NULL;
    }

    knem_fini(ni);

#if !USE_KNEM
    PTL_FASTLOCK_DESTROY(&ni->shmem.noknem_lock);
#endif
}
static void
cell_list_fini(struct cell_list *cells)
{
    pool_fini (cells->cell_pool.base);
}
Example #3
0
File: slab.c Project: kezhuw/swiff
void
slab_pool_delete(struct slab_pool *so) {
	struct slab *po = (struct slab *)so;
	pool_fini(po);
	po->dealloc(po->memctx, po, __FILE__, __LINE__);
}