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
add a small comment about the memleak introduced here
[simgrid.git]
/
src
/
bindings
/
java
/
jmsg_task.cpp
diff --git
a/src/bindings/java/jmsg_task.cpp
b/src/bindings/java/jmsg_task.cpp
index
14764bd
..
47182e2
100644
(file)
--- a/
src/bindings/java/jmsg_task.cpp
+++ b/
src/bindings/java/jmsg_task.cpp
@@
-476,6
+476,10
@@
static void msg_task_cancel_on_failed_dsend(void*t) {
/* Destroy the global ref so that the JVM can free the stuff */
env->DeleteGlobalRef(jtask_global);
MSG_task_set_data(task, nullptr);
/* Destroy the global ref so that the JVM can free the stuff */
env->DeleteGlobalRef(jtask_global);
MSG_task_set_data(task, nullptr);
+ /* Don't free the C data here, to avoid a race condition with the GC also sometimes doing so.
+ * A rare memleak is seen as preferable to a rare "free(): invalid pointer" failure that
+ * proves really hard to debug.
+ */
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsend(JNIEnv * env, jobject jtask, jstring jalias)
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsend(JNIEnv * env, jobject jtask, jstring jalias)