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 Mailbox::get_unique<>(), and save a few delete.
[simgrid.git]
/
teshsuite
/
s4u
/
ns3-from-src-to-itself
/
ns3-from-src-to-itself.cpp
diff --git
a/teshsuite/s4u/ns3-from-src-to-itself/ns3-from-src-to-itself.cpp
b/teshsuite/s4u/ns3-from-src-to-itself/ns3-from-src-to-itself.cpp
index c9aa53d034a95e66e5942b3318d09ec26f00bdbd..50ed51e2f6a751f368b56488f4402c9419240012 100644
(file)
--- a/
teshsuite/s4u/ns3-from-src-to-itself/ns3-from-src-to-itself.cpp
+++ b/
teshsuite/s4u/ns3-from-src-to-itself/ns3-from-src-to-itself.cpp
@@
-33,10
+33,9
@@
static void test_receive()
{
for (int nb_message = 0; nb_message < nb_message_to_send * nb_sender; nb_message++) {
XBT_VERB("waiting for messages");
{
for (int nb_message = 0; nb_message < nb_message_to_send * nb_sender; nb_message++) {
XBT_VERB("waiting for messages");
-
int* ptr = box->get
<int>();
+
auto ptr = box->get_unique
<int>();
int id = *ptr;
XBT_VERB("received messages #%i", id);
int id = *ptr;
XBT_VERB("received messages #%i", id);
- delete ptr;
}
XBT_INFO("Done receiving from %d senders, each of them sending %d messages", nb_sender, nb_message_to_send);
}
}
XBT_INFO("Done receiving from %d senders, each of them sending %d messages", nb_sender, nb_message_to_send);
}