Exemplo n.º 1
0
/** @brief finalize common datastructures to all models */
void surf_model_exit(surf_model_t model)
{
  xbt_swag_free(model->states.ready_action_set);
  xbt_swag_free(model->states.running_action_set);
  xbt_swag_free(model->states.failed_action_set);
  xbt_swag_free(model->states.done_action_set);
  free(model->model_private);
  free(model);
}
Exemplo n.º 2
0
/**
 * \brief Destroys a mutex.
 *
 * Destroys and frees the mutex's memory. 
 * \param mutex A mutex
 */
void SIMIX_mutex_destroy(smx_mutex_t mutex)
{
  XBT_IN("(%p)",mutex);
  if (mutex){
    xbt_swag_free(mutex->sleeping);
    xbt_free(mutex);
  }
  XBT_OUT();
}
Exemplo n.º 3
0
void SIMIX_request_destroy(void)
{
  int i, nthreads = SIMIX_context_get_nthreads();

  for(i=0; i < nthreads; i++)
    xbt_swag_free(req_lists[i]);

  xbt_free(req_lists);
}
Exemplo n.º 4
0
void intrusive_ptr_release(s_smx_cond_t *cond)
{
  auto count = --(cond->refcount_);
  if (count == 0) {
    xbt_assert(xbt_swag_size(cond->sleeping) == 0,
                "Cannot destroy conditional since someone is still using it");
    xbt_swag_free(cond->sleeping);
    delete cond;
  }
}
Exemplo n.º 5
0
/** @brief Destroys a semaphore */
void SIMIX_sem_destroy(smx_sem_t sem)
{
  XBT_IN("(%p)",sem);
  XBT_DEBUG("Destroy semaphore %p", sem);
  if (sem != NULL) {
    xbt_assert(xbt_swag_size(sem->sleeping) == 0,
                "Cannot destroy semaphore since someone is still using it");
    xbt_swag_free(sem->sleeping);
    xbt_free(sem);
  }
  XBT_OUT();
}
Exemplo n.º 6
0
/*
 * \brief Destroys a host (internal call only)
 */
void __MSG_host_destroy(msg_host_priv_t host) {

#ifdef MSG_USE_DEPRECATED
  if (msg_global->max_channel > 0)
    free(host->mailboxes);
#endif
  if (xbt_swag_size(host->vms) > 0 ) {
    XBT_VERB("Host shut down, but it still hosts %d VMs. They will be leaked.",xbt_swag_size(host->vms));
  }
  xbt_swag_free(host->vms);
  free(host);
}
Exemplo n.º 7
0
static void new_model_finalize(void)
{
    lmm_system_free(new_model_maxmin_system);
    new_model_maxmin_system = NULL;

    surf_model_exit(surf_new_model);
    surf_new_model = NULL;

    xbt_swag_free
    (new_model_running_action_set_that_does_not_need_being_checked);
    new_model_running_action_set_that_does_not_need_being_checked = NULL;
}
Exemplo n.º 8
0
/**
 * \brief Destroys a contidion.
 *
 * Destroys and frees the condition's memory. 
 * \param cond A condition
 */
void SIMIX_cond_destroy(smx_cond_t cond)
{
  XBT_IN("(%p)",cond);
  XBT_DEBUG("Destroy condition %p", cond);

  if (cond != NULL) {
    xbt_assert(xbt_swag_size(cond->sleeping) == 0,
                "Cannot destroy conditional since someone is still using it");

    xbt_swag_free(cond->sleeping);
    xbt_free(cond);
  }
  XBT_OUT();
}
Exemplo n.º 9
0
StorageN11Model::~StorageN11Model(){
  xbt_swag_free(storage_running_action_set_that_does_not_need_being_checked);
  storage_running_action_set_that_does_not_need_being_checked = nullptr;
}
Exemplo n.º 10
0
Mutex::~Mutex()
{
  XBT_IN("(%p)", this);
  xbt_swag_free(this->sleeping);
  XBT_OUT();
}