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
[appveyor] more verbose on problems
[simgrid.git]
/
teshsuite
/
simdag
/
availability
/
availability_test.c
diff --git
a/teshsuite/simdag/availability/availability_test.c
b/teshsuite/simdag/availability/availability_test.c
index
1fb03f4
..
9389625
100644
(file)
--- a/
teshsuite/simdag/availability/availability_test.c
+++ b/
teshsuite/simdag/availability/availability_test.c
@@
-1,9
+1,15
@@
+/* Copyright (c) 2013-2014. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <unistd.h>
-#include <sim
dag
/simdag.h>
+#include <sim
grid
/simdag.h>
#include <xbt/log.h>
#include <xbt/ex.h>
#include <signal.h>
#include <xbt/log.h>
#include <xbt/ex.h>
#include <signal.h>
@@
-138,7
+144,8
@@
static xbt_dynar_t initDynamicThrottling(int *argc, char *argv[])
fprintf(stdout, "Scheduling DAX...\n");
scheduleDAX(dax);
fprintf(stdout, "DAX scheduled\n");
fprintf(stdout, "Scheduling DAX...\n");
scheduleDAX(dax);
fprintf(stdout, "DAX scheduled\n");
- SD_simulate(-1);
+ xbt_dynar_t ret = SD_simulate(-1);
+ xbt_dynar_free(&ret);
fprintf(stdout, "Simulation end. Time: %f\n", SD_get_clock());
return dax;
fprintf(stdout, "Simulation end. Time: %f\n", SD_get_clock());
return dax;
@@
-149,11
+156,11
@@
static xbt_dynar_t initDynamicThrottling(int *argc, char *argv[])
*/
static void garbageCollector(xbt_dynar_t dax)
{
*/
static void garbageCollector(xbt_dynar_t dax)
{
- SD_task_t task;
- unsigned int cursor;
- xbt_dynar_foreach(dax, cursor, task) {
+ while (!xbt_dynar_is_empty(dax)) {
+ SD_task_t task = xbt_dynar_pop_as(dax, SD_task_t);
SD_task_destroy(task);
}
SD_task_destroy(task);
}
+ xbt_dynar_free(&dax);
SD_exit();
}
SD_exit();
}