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
plug the memleaks of the cloud-capping example
[simgrid.git]
/
examples
/
msg
/
cloud-capping
/
cloud-capping.c
diff --git
a/examples/msg/cloud-capping/cloud-capping.c
b/examples/msg/cloud-capping/cloud-capping.c
index
aef3626
..
91fcdbe
100644
(file)
--- a/
examples/msg/cloud-capping/cloud-capping.c
+++ b/
examples/msg/cloud-capping/cloud-capping.c
@@
-55,6
+55,7
@@
static int worker_busy_loop_main(int argc, char *argv[])
{
msg_task_t *task = MSG_process_get_data(MSG_process_self());
MSG_task_execute(*task);
+ MSG_task_destroy(*task);
return 0;
}
@@
-66,6
+67,7
@@
static void test_dynamic_change(void)
{
xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
+ xbt_dynar_free(&hosts_dynar);
msg_host_t vm0 = MSG_vm_create_core(pm0, "VM0");
msg_host_t vm1 = MSG_vm_create_core(pm0, "VM1");
@@
-198,6
+200,7
@@
static int master_main(int argc, char *argv[])
xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
msg_host_t pm1 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
+ xbt_dynar_free(&hosts_dynar);
XBT_INFO("# 1. Put a single task on a PM. ");
test_one_task(pm0);
@@
-313,6
+316,7
@@
int main(int argc, char *argv[])
xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
launch_master(pm0);
+ xbt_dynar_free(&hosts_dynar);
int res = MSG_main();
XBT_INFO("Bye (simulation time %g)", MSG_get_clock());