diff --git a/src/jltypes.c b/src/jltypes.c index 0767e9493bbc0..e7c1fd9d9c9c2 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -2600,7 +2600,7 @@ void jl_init_types(void) JL_GC_DISABLED jl_method_type = jl_new_datatype(jl_symbol("Method"), core, jl_any_type, jl_emptysvec, - jl_perm_symsvec(29, + jl_perm_symsvec(30, "name", "module", "file", @@ -2629,8 +2629,9 @@ void jl_init_types(void) JL_GC_DISABLED "pure", "is_for_opaque_closure", "constprop", - "purity"), - jl_svec(29, + "purity", + "num_dynamic_dispatches"), + jl_svec(30, jl_symbol_type, jl_module_type, jl_symbol_type, @@ -2659,7 +2660,8 @@ void jl_init_types(void) JL_GC_DISABLED jl_bool_type, jl_bool_type, jl_uint8_type, - jl_uint8_type), + jl_uint8_type, + jl_int32_type), jl_emptysvec, 0, 1, 10); //const static uint32_t method_constfields[1] = { 0x03fc065f }; // (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<6)|(1<<9)|(1<<10)|(1<<18)|(1<<19)|(1<<20)|(1<<21)|(1<<22)|(1<<23)|(1<<24)|(1<<25); diff --git a/src/julia.h b/src/julia.h index 7ac44cbacfef3..136cb5a968ba9 100644 --- a/src/julia.h +++ b/src/julia.h @@ -349,12 +349,13 @@ typedef struct _jl_method_t { // forcing the conclusion to always true. _jl_purity_overrides_t purity; -// hidden fields: - // lock for modifications to the method - jl_mutex_t writelock; #ifdef JL_DISPATCH_LOG_BOXES uint32_t num_dynamic_dispatches; #endif + +// hidden fields: + // lock for modifications to the method + jl_mutex_t writelock; } jl_method_t; // This type is a placeholder to cache data for a specType signature specialization of a Method diff --git a/src/method.c b/src/method.c index a659b9aa44d56..c5e595fa75719 100644 --- a/src/method.c +++ b/src/method.c @@ -805,10 +805,10 @@ JL_DLLEXPORT jl_method_t *jl_new_method_uninit(jl_module_t *module) m->deleted_world = ~(size_t)0; m->is_for_opaque_closure = 0; m->constprop = 0; - JL_MUTEX_INIT(&m->writelock); #ifdef JL_DISPATCH_LOG_BOXES m->num_dynamic_dispatches = 0; #endif + JL_MUTEX_INIT(&m->writelock); return m; }