int host_count = static_cast<int>(env->GetArrayLength(jhosts));
jdouble* jcomputeDurations = env->GetDoubleArrayElements(jcomputeDurations_arg, 0);
- msg_host_t* hosts = xbt_new0(msg_host_t, host_count);
+ msg_host_t* hosts = new msg_host_t[host_count];
double* computeDurations = xbt_new0(double, host_count);
for (int index = 0; index < host_count; index++) {
jobject jhost = env->GetObjectArrayElement(jhosts, index);
/* associate the java task object and the native task */
jtask_bind(jtask, task, env);
+
+ delete[] hosts;
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel(JNIEnv * env, jobject jtask)
return nullptr;
//pointer to store the task object pointer.
- msg_task_t *task = xbt_new(msg_task_t,1);
- *task = nullptr;
+ msg_task_t* task = new msg_task_t(nullptr);
/* There should be a cache here */
jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
return nullptr;
// pointer to store the task object pointer.
- msg_task_t* task = xbt_new0(msg_task_t, 1);
+ msg_task_t* task = new msg_task_t(nullptr);
jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
if (not jcomm) {