Skip to content

Commit 10351ad

Browse files
committed
Cannot make num_dynamic_dispatches a "hidden" field
Unsure why but it doesn't really matter.
1 parent fd3cc3a commit 10351ad

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/jltypes.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2600,7 +2600,7 @@ void jl_init_types(void) JL_GC_DISABLED
26002600
jl_method_type =
26012601
jl_new_datatype(jl_symbol("Method"), core,
26022602
jl_any_type, jl_emptysvec,
2603-
jl_perm_symsvec(29,
2603+
jl_perm_symsvec(30,
26042604
"name",
26052605
"module",
26062606
"file",
@@ -2629,8 +2629,9 @@ void jl_init_types(void) JL_GC_DISABLED
26292629
"pure",
26302630
"is_for_opaque_closure",
26312631
"constprop",
2632-
"purity"),
2633-
jl_svec(29,
2632+
"purity",
2633+
"num_dynamic_dispatches"),
2634+
jl_svec(30,
26342635
jl_symbol_type,
26352636
jl_module_type,
26362637
jl_symbol_type,
@@ -2659,7 +2660,8 @@ void jl_init_types(void) JL_GC_DISABLED
26592660
jl_bool_type,
26602661
jl_bool_type,
26612662
jl_uint8_type,
2662-
jl_uint8_type),
2663+
jl_uint8_type,
2664+
jl_int32_type),
26632665
jl_emptysvec,
26642666
0, 1, 10);
26652667
//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);

src/julia.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,13 @@ typedef struct _jl_method_t {
349349
// forcing the conclusion to always true.
350350
_jl_purity_overrides_t purity;
351351

352-
// hidden fields:
353-
// lock for modifications to the method
354-
jl_mutex_t writelock;
355352
#ifdef JL_DISPATCH_LOG_BOXES
356353
uint32_t num_dynamic_dispatches;
357354
#endif
355+
356+
// hidden fields:
357+
// lock for modifications to the method
358+
jl_mutex_t writelock;
358359
} jl_method_t;
359360

360361
// This type is a placeholder to cache data for a specType signature specialization of a Method

src/method.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,10 +805,10 @@ JL_DLLEXPORT jl_method_t *jl_new_method_uninit(jl_module_t *module)
805805
m->deleted_world = ~(size_t)0;
806806
m->is_for_opaque_closure = 0;
807807
m->constprop = 0;
808-
JL_MUTEX_INIT(&m->writelock);
809808
#ifdef JL_DISPATCH_LOG_BOXES
810809
m->num_dynamic_dispatches = 0;
811810
#endif
811+
JL_MUTEX_INIT(&m->writelock);
812812
return m;
813813
}
814814

0 commit comments

Comments
 (0)