path: root/mjit_compile.c
diff options
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-11 07:57:58 (GMT)
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-11 07:57:58 (GMT)
commitddcb40f5952965561ca19d97495ebeb977590060 (patch)
tree3c46754c18a7be81b62a440b0700dacfe01fc9bc /mjit_compile.c
parentc9a30858fcac984f7c49084584f7b18deac32383 (diff)
mjit_worker.c: carve out worker-related code
The motivation of this change is to make sure rb_funcall or GC-related functions are not called on worker-related code. Currently such functions are used in some places and I believe it's partly because it's hard to identify which part is called on MJIT worker thread. Now, mjit.c is safe to use them but we know we need to safely deal with mjit_compile.c, mjit_worker.c and mjit_internal.h. mjit_compile.c: update the comment about it git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit_compile.c')
1 files changed, 4 insertions, 0 deletions
diff --git a/mjit_compile.c b/mjit_compile.c
index 63a2483..63d0757 100644
--- a/mjit_compile.c
+++ b/mjit_compile.c
@@ -6,6 +6,10 @@
+/* NOTE: All functions in this file are executed on MJIT worker. So don't
+ call Ruby methods (C functions that may call rb_funcall) or trigger
+ GC (using xmalloc, ZALLOC, etc.) in this file. */
#include "internal.h"
#include "vm_core.h"
#include "vm_exec.h"