コード例 #1
0
ファイル: maxmin.cpp プロジェクト: luizabeltrame/simgrid
void lmm_system_free(lmm_system_t sys)
{
  lmm_variable_t var = nullptr;
  lmm_constraint_t cnst = nullptr;

  if (!sys)
    return;

  while ((var = (lmm_variable_t) extract_variable(sys))) {
    XBT_WARN("Variable %d still in system when freing it: this may be a bug", var->id_int);
    lmm_var_free(sys, var);
  }
  while ((cnst = (lmm_constraint_t) extract_constraint(sys)))
    lmm_cnst_free(sys, cnst);

  xbt_mallocator_free(sys->variable_mallocator);
  free(sys);
}
コード例 #2
0
ファイル: maxmin.cpp プロジェクト: frs69wq/simgrid
void lmm_system_free(lmm_system_t sys)
{
  lmm_variable_t var = NULL;
  lmm_constraint_t cnst = NULL;

  while ((var = (lmm_variable_t) extract_variable(sys))) {
    XBT_WARN
        ("Variable %p (%d) still in LMM system when freing it: this may be a bug",
         var, var->id_int);
    lmm_var_free(sys, var);
  }

  while ((cnst = (lmm_constraint_t) extract_constraint(sys)))
    lmm_cnst_free(sys, cnst);

  xbt_mallocator_free(sys->variable_mallocator);
  free(sys);
}