X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/66acb13a76dfe861a60220704697e361495e0eb0..0c07b616d38841a028f8a34fe66394e232008b5e:/src/surf/cpu_ti.cpp diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 90e5e8510e..97ee3c2cac 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -32,8 +32,8 @@ CpuTiTrace::CpuTiTrace(tmgr_trace_t speedTrace) double time = 0; int i = 0; nbPoints_ = speedTrace->event_list.size() + 1; - timePoints_ = static_cast(xbt_malloc0(sizeof(double) * nbPoints_)); - integral_ = static_cast(xbt_malloc0(sizeof(double) * nbPoints_)); + timePoints_ = new double[nbPoints_]; + integral_ = new double[nbPoints_]; for (auto val : speedTrace->event_list) { timePoints_[i] = time; integral_[i] = integral; @@ -47,8 +47,8 @@ CpuTiTrace::CpuTiTrace(tmgr_trace_t speedTrace) CpuTiTrace::~CpuTiTrace() { - xbt_free(timePoints_); - xbt_free(integral_); + delete [] timePoints_; + delete [] integral_; } CpuTiTgmr::~CpuTiTgmr() @@ -360,7 +360,7 @@ Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host, std::vector* speedP return new CpuTi(this, host, speedPerPstate, core); } -double CpuTiModel::next_occuring_event(double now) +double CpuTiModel::nextOccuringEvent(double now) { double min_action_duration = -1; @@ -459,7 +459,7 @@ void CpuTi::apply_event(tmgr_trace_iterator_t event, double value) } else if (event == stateEvent_) { if (value > 0) { if(isOff()) - xbt_dynar_push_as(host_that_restart, char*, (char *)getName()); + host_that_restart.push_back(getHost()); turnOn(); } else { turnOff();