@@ -194,7 +194,9 @@ class JuliaJITEventListener: public JITEventListener
194
194
virtual void NotifyFunctionEmitted (const Function &F, void *Code,
195
195
size_t Size , const EmittedFunctionDetails &Details)
196
196
{
197
+ int8_t gc_state = jl_gc_state_save_and_set (3 );
197
198
uv_rwlock_wrlock (&threadsafe);
199
+ jl_gc_state_set (gc_state, 3 );
198
200
#if defined(_OS_WINDOWS_)
199
201
create_PRUNTIME_FUNCTION ((uint8_t *)Code, Size , F.getName (), (uint8_t *)Code, Size , NULL );
200
202
#endif
@@ -205,7 +207,9 @@ class JuliaJITEventListener: public JITEventListener
205
207
206
208
std::map<size_t , FuncInfo, revcomp>& getMap ()
207
209
{
210
+ int8_t gc_state = jl_gc_state_save_and_set (3 );
208
211
uv_rwlock_rdlock (&threadsafe);
212
+ jl_gc_state_set (gc_state, 3 );
209
213
return info;
210
214
}
211
215
#endif // ifndef USE_MCJIT
@@ -218,7 +222,9 @@ class JuliaJITEventListener: public JITEventListener
218
222
virtual void NotifyObjectEmitted (const ObjectImage &obj)
219
223
#endif
220
224
{
225
+ int8_t gc_state = jl_gc_state_save_and_set (3 );
221
226
uv_rwlock_wrlock (&threadsafe);
227
+ jl_gc_state_set (gc_state, 3 );
222
228
#ifdef LLVM36
223
229
object::section_iterator Section = obj.section_begin ();
224
230
object::section_iterator EndSection = obj.section_end ();
@@ -451,7 +457,9 @@ class JuliaJITEventListener: public JITEventListener
451
457
452
458
std::map<size_t , ObjectInfo, revcomp>& getObjectMap ()
453
459
{
460
+ int8_t gc_state = jl_gc_state_save_and_set (3 );
454
461
uv_rwlock_rdlock (&threadsafe);
462
+ jl_gc_state_set (gc_state, 3 );
455
463
return objectmap;
456
464
}
457
465
#endif // USE_MCJIT
0 commit comments