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
Replace some malloc/free by C++ new/delete.
[simgrid.git]
/
src
/
msg
/
msg_task.cpp
diff --git
a/src/msg/msg_task.cpp
b/src/msg/msg_task.cpp
index
42a69af
..
f07beb0
100644
(file)
--- a/
src/msg/msg_task.cpp
+++ b/
src/msg/msg_task.cpp
@@
-1,12
+1,13
@@
-/* Copyright (c) 2004-201
6
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-201
7
. 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. */
/* 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 "msg_private.h"
-#include "src/simix/smx_private.h"
+#include "msg_private.hpp"
+#include "src/simix/smx_private.hpp"
+#include <algorithm>
-SG_BEGIN_DECL()
+extern "C" {
/** @addtogroup m_task_management
*
/** @addtogroup m_task_management
*
@@
-18,7
+19,7
@@
SG_BEGIN_DECL()
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)");
-void s
imdata_task
::reportMultipleUse() const
+void s
_simdata_task_t
::reportMultipleUse() const
{
if (msg_global->debug_multiple_use){
XBT_ERROR("This task is already used in there:");
{
if (msg_global->debug_multiple_use){
XBT_ERROR("This task is already used in there:");
@@
-90,12
+91,11
@@
msg_task_t MSG_parallel_task_create(const char *name, int host_nb, const msg_hos
/* Simulator Data specific to parallel tasks */
simdata->host_nb = host_nb;
/* Simulator Data specific to parallel tasks */
simdata->host_nb = host_nb;
- simdata->host_list
= xbt_new0(sg_host_t, host_nb)
;
+ simdata->host_list
= new sg_host_t[host_nb]
;
simdata->flops_parallel_amount = flops_amount;
simdata->bytes_parallel_amount = bytes_amount;
simdata->flops_parallel_amount = flops_amount;
simdata->bytes_parallel_amount = bytes_amount;
- for (int i = 0; i < host_nb; i++)
- simdata->host_list[i] = host_list[i];
+ std::copy_n(host_list, host_nb, simdata->host_list);
return task;
}
return task;
}
@@
-304,5
+304,4
@@
void MSG_task_set_bound(msg_task_t task, double bound)
if (task->simdata->compute)
simcall_execution_set_bound(task->simdata->compute, task->simdata->bound);
}
if (task->simdata->compute)
simcall_execution_set_bound(task->simdata->compute, task->simdata->bound);
}
-
-SG_END_DECL()
+}