A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use new/delete and remove useless cast.
[simgrid.git]
/
src
/
s4u
/
s4u_comm.cpp
diff --git
a/src/s4u/s4u_comm.cpp
b/src/s4u/s4u_comm.cpp
index
ac55817
..
be0db14
100644
(file)
--- a/
src/s4u/s4u_comm.cpp
+++ b/
src/s4u/s4u_comm.cpp
@@
-138,12
+138,12
@@
Activity* Comm::wait(double timeout)
}
int Comm::test_any(std::vector<CommPtr>* comms)
{
}
int Comm::test_any(std::vector<CommPtr>* comms)
{
- smx_activity_t* array =
static_cast<smx_activity_t*>(malloc(sizeof(smx_activity_t) * comms->size()))
;
+ smx_activity_t* array =
new smx_activity_t[comms->size()]
;
for (unsigned int i = 0; i < comms->size(); i++) {
array[i] = comms->at(i)->pimpl_;
}
for (unsigned int i = 0; i < comms->size(); i++) {
array[i] = comms->at(i)->pimpl_;
}
- int res = simcall_comm_testany(array,
static_cast<size_t>(comms->size()
));
-
free(array)
;
+ int res = simcall_comm_testany(array,
comms->size(
));
+
delete[] array
;
return res;
}
return res;
}