Skip to content

Commit ab60fc6

Browse files
committed
pass alignment from the outside jl_gc_alloc
1 parent cf1f1e8 commit ab60fc6

14 files changed

+83
-79
lines changed

src/array.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static jl_array_t *_new_array_(jl_value_t *atype, uint32_t ndims, size_t *dims,
9393
size_t doffs = tsz;
9494
tsz += tot;
9595
tsz = JL_ARRAY_ALIGN(tsz, JL_SMALL_BYTE_ALIGNMENT); // align whole object
96-
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, atype);
96+
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, JL_SMALL_BYTE_ALIGNMENT, atype);
9797
// No allocation or safepoint allowed after this
9898
a->flags.how = 0;
9999
data = (char*)a + doffs;
@@ -105,7 +105,7 @@ static jl_array_t *_new_array_(jl_value_t *atype, uint32_t ndims, size_t *dims,
105105
data = jl_gc_managed_malloc(tot);
106106
// Allocate the Array **after** allocating the data
107107
// to make sure the array is still young
108-
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, atype);
108+
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, JL_CACHE_BYTE_ALIGNMENT, atype);
109109
// No allocation or safepoint allowed after this
110110
a->flags.how = 2;
111111
jl_gc_track_malloced_array(ptls, a);
@@ -181,7 +181,7 @@ JL_DLLEXPORT jl_array_t *jl_reshape_array(jl_value_t *atype, jl_array_t *data,
181181

182182
int ndimwords = jl_array_ndimwords(ndims);
183183
int tsz = JL_ARRAY_ALIGN(sizeof(jl_array_t) + ndimwords*sizeof(size_t) + sizeof(void*), JL_SMALL_BYTE_ALIGNMENT);
184-
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, atype);
184+
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, JL_SMALL_BYTE_ALIGNMENT, atype);
185185
// No allocation or safepoint allowed after this
186186
a->flags.pooled = tsz <= GC_MAX_SZCLASS;
187187
a->flags.ndims = ndims;
@@ -251,7 +251,7 @@ JL_DLLEXPORT jl_array_t *jl_string_to_array(jl_value_t *str)
251251

252252
int ndimwords = jl_array_ndimwords(1);
253253
int tsz = JL_ARRAY_ALIGN(sizeof(jl_array_t) + ndimwords*sizeof(size_t) + sizeof(void*), JL_SMALL_BYTE_ALIGNMENT);
254-
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, jl_array_uint8_type);
254+
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, JL_SMALL_BYTE_ALIGNMENT, jl_array_uint8_type);
255255
a->flags.pooled = tsz <= GC_MAX_SZCLASS;
256256
a->flags.ndims = 1;
257257
a->offset = 0;
@@ -294,7 +294,7 @@ JL_DLLEXPORT jl_array_t *jl_ptr_to_array_1d(jl_value_t *atype, void *data,
294294

295295
int ndimwords = jl_array_ndimwords(1);
296296
int tsz = JL_ARRAY_ALIGN(sizeof(jl_array_t) + ndimwords*sizeof(size_t), JL_CACHE_BYTE_ALIGNMENT);
297-
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, atype);
297+
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, JL_CACHE_BYTE_ALIGNMENT, atype);
298298
// No allocation or safepoint allowed after this
299299
a->flags.pooled = tsz <= GC_MAX_SZCLASS;
300300
a->data = data;
@@ -357,7 +357,7 @@ JL_DLLEXPORT jl_array_t *jl_ptr_to_array(jl_value_t *atype, void *data,
357357

358358
int ndimwords = jl_array_ndimwords(ndims);
359359
int tsz = JL_ARRAY_ALIGN(sizeof(jl_array_t) + ndimwords*sizeof(size_t), JL_CACHE_BYTE_ALIGNMENT);
360-
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, atype);
360+
a = (jl_array_t*)jl_gc_alloc(ptls, tsz, JL_CACHE_BYTE_ALIGNMENT, atype);
361361
// No allocation or safepoint allowed after this
362362
a->flags.pooled = tsz <= GC_MAX_SZCLASS;
363363
a->data = data;
@@ -434,7 +434,7 @@ JL_DLLEXPORT jl_value_t *jl_array_to_string(jl_array_t *a)
434434

435435
JL_DLLEXPORT jl_value_t *jl_pchar_to_string(const char *str, size_t len)
436436
{
437-
jl_value_t *s = jl_gc_alloc(jl_get_ptls_states(), sizeof(size_t)+len+1, jl_string_type);
437+
jl_value_t *s = jl_gc_alloc(jl_get_ptls_states(), sizeof(size_t)+len+1, /*align*/ 0, jl_string_type);
438438
*(size_t*)s = len;
439439
memcpy((char*)s + sizeof(size_t), str, len);
440440
((char*)s + sizeof(size_t))[len] = 0;
@@ -443,7 +443,7 @@ JL_DLLEXPORT jl_value_t *jl_pchar_to_string(const char *str, size_t len)
443443

444444
JL_DLLEXPORT jl_value_t *jl_alloc_string(size_t len)
445445
{
446-
jl_value_t *s = jl_gc_alloc(jl_get_ptls_states(), sizeof(size_t)+len+1, jl_string_type);
446+
jl_value_t *s = jl_gc_alloc(jl_get_ptls_states(), sizeof(size_t)+len+1, /*align*/ 0, jl_string_type);
447447
*(size_t*)s = len;
448448
((char*)s + sizeof(size_t))[len] = 0;
449449
return s;

src/builtins.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ jl_expr_t *jl_exprn(jl_sym_t *head, size_t n)
859859
jl_ptls_t ptls = jl_get_ptls_states();
860860
jl_array_t *ar = n==0 ? (jl_array_t*)jl_an_empty_vec_any : jl_alloc_vec_any(n);
861861
JL_GC_PUSH1(&ar);
862-
jl_expr_t *ex = (jl_expr_t*)jl_gc_alloc(ptls, sizeof(jl_expr_t),
862+
jl_expr_t *ex = (jl_expr_t*)jl_gc_alloc(ptls, sizeof(jl_expr_t), /*align*/ 0,
863863
jl_expr_type);
864864
ex->head = head;
865865
ex->args = ar;
@@ -877,7 +877,7 @@ JL_CALLABLE(jl_f__expr)
877877
JL_GC_PUSH1(&ar);
878878
for(size_t i=0; i < nargs-1; i++)
879879
jl_array_ptr_set(ar, i, args[i+1]);
880-
jl_expr_t *ex = (jl_expr_t*)jl_gc_alloc(ptls, sizeof(jl_expr_t),
880+
jl_expr_t *ex = (jl_expr_t*)jl_gc_alloc(ptls, sizeof(jl_expr_t), /*align*/ 0,
881881
jl_expr_type);
882882
ex->head = (jl_sym_t*)args[0];
883883
ex->args = ar;

src/datatype.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ JL_DLLEXPORT jl_methtable_t *jl_new_method_table(jl_sym_t *name, jl_module_t *mo
3636
{
3737
jl_ptls_t ptls = jl_get_ptls_states();
3838
jl_methtable_t *mt =
39-
(jl_methtable_t*)jl_gc_alloc(ptls, sizeof(jl_methtable_t),
39+
(jl_methtable_t*)jl_gc_alloc(ptls, sizeof(jl_methtable_t), 0,
4040
jl_methtable_type);
4141
mt->name = jl_demangle_typename(name);
4242
mt->module = module;
@@ -53,7 +53,7 @@ JL_DLLEXPORT jl_typename_t *jl_new_typename_in(jl_sym_t *name, jl_module_t *modu
5353
{
5454
jl_ptls_t ptls = jl_get_ptls_states();
5555
jl_typename_t *tn =
56-
(jl_typename_t*)jl_gc_alloc(ptls, sizeof(jl_typename_t),
56+
(jl_typename_t*)jl_gc_alloc(ptls, sizeof(jl_typename_t), 0,
5757
jl_typename_type);
5858
tn->name = name;
5959
tn->module = module;
@@ -82,7 +82,7 @@ jl_datatype_t *jl_new_abstracttype(jl_value_t *name, jl_datatype_t *super, jl_sv
8282
jl_datatype_t *jl_new_uninitialized_datatype(void)
8383
{
8484
jl_ptls_t ptls = jl_get_ptls_states();
85-
jl_datatype_t *t = (jl_datatype_t*)jl_gc_alloc(ptls, sizeof(jl_datatype_t), jl_datatype_type);
85+
jl_datatype_t *t = (jl_datatype_t*)jl_gc_alloc(ptls, sizeof(jl_datatype_t), 0, jl_datatype_type);
8686
t->depth = 0;
8787
t->hasfreetypevars = 0;
8888
t->isleaftype = 1;
@@ -447,7 +447,7 @@ static jl_value_t *jl_new_bits_internal(jl_value_t *dt, void *data, size_t *len)
447447
if (bt == jl_int32_type) return jl_box_int32(*(int32_t*)data);
448448
if (bt == jl_float64_type) return jl_box_float64(*(double*)data);
449449

450-
jl_value_t *v = jl_gc_alloc(ptls, nb, bt);
450+
jl_value_t *v = jl_gc_alloc(ptls, nb, jl_datatype_align(bt), bt);
451451
switch (nb) {
452452
case 1: *(int8_t*) jl_data_ptr(v) = *(int8_t*)data; break;
453453
case 2: *(int16_t*) jl_data_ptr(v) = *(int16_t*)data; break;
@@ -485,7 +485,8 @@ void jl_assign_bits(void *dest, jl_value_t *bits)
485485
jl_ptls_t ptls = jl_get_ptls_states(); \
486486
assert(jl_isbits(t)); \
487487
assert(jl_datatype_size(t) == sizeof(x)); \
488-
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), t); \
488+
size_t align = jl_datatype_align(t); \
489+
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), align, t);\
489490
*(int##nb##_t*)jl_data_ptr(v) = x; \
490491
return v; \
491492
} \
@@ -530,7 +531,7 @@ UNBOX_FUNC(voidpointer, void*)
530531
JL_DLLEXPORT jl_value_t *pfx##_##typ(c_type x) \
531532
{ \
532533
jl_ptls_t ptls = jl_get_ptls_states(); \
533-
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), \
534+
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), 0,\
534535
jl_##typ##_type); \
535536
*(c_type*)jl_data_ptr(v) = x; \
536537
return v; \
@@ -553,7 +554,7 @@ BOX_FUNC(float64, double, jl_box, 2)
553554
c_type idx = x+NBOX_C/2; \
554555
if ((u##c_type)idx < (u##c_type)NBOX_C) \
555556
return boxed_##typ##_cache[idx]; \
556-
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), \
557+
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), 0,\
557558
jl_##typ##_type); \
558559
*(c_type*)jl_data_ptr(v) = x; \
559560
return v; \
@@ -565,7 +566,7 @@ BOX_FUNC(float64, double, jl_box, 2)
565566
jl_ptls_t ptls = jl_get_ptls_states(); \
566567
if (x < NBOX_C) \
567568
return boxed_##typ##_cache[x]; \
568-
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), \
569+
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), 0,\
569570
jl_##typ##_type); \
570571
*(c_type*)jl_data_ptr(v) = x; \
571572
return v; \
@@ -646,7 +647,7 @@ JL_DLLEXPORT jl_value_t *jl_new_struct(jl_datatype_t *type, ...)
646647
va_list args;
647648
size_t nf = jl_datatype_nfields(type);
648649
va_start(args, type);
649-
jl_value_t *jv = jl_gc_alloc(ptls, jl_datatype_size(type), type);
650+
jl_value_t *jv = jl_gc_alloc(ptls, jl_datatype_size(type), jl_datatype_align(type), type);
650651
for(size_t i=0; i < nf; i++) {
651652
jl_set_nth_field(jv, i, va_arg(args, jl_value_t*));
652653
}
@@ -660,7 +661,7 @@ JL_DLLEXPORT jl_value_t *jl_new_structv(jl_datatype_t *type, jl_value_t **args,
660661
jl_ptls_t ptls = jl_get_ptls_states();
661662
if (type->instance != NULL) return type->instance;
662663
size_t nf = jl_datatype_nfields(type);
663-
jl_value_t *jv = jl_gc_alloc(ptls, jl_datatype_size(type), type);
664+
jl_value_t *jv = jl_gc_alloc(ptls, jl_datatype_size(type), jl_datatype_align(type), type);
664665
for(size_t i=0; i < na; i++) {
665666
jl_set_nth_field(jv, i, args[i]);
666667
}
@@ -676,8 +677,9 @@ JL_DLLEXPORT jl_value_t *jl_new_struct_uninit(jl_datatype_t *type)
676677
{
677678
jl_ptls_t ptls = jl_get_ptls_states();
678679
if (type->instance != NULL) return type->instance;
679-
size_t size = jl_datatype_size(type);
680-
jl_value_t *jv = jl_gc_alloc(ptls, size, type);
680+
size_t size = jl_datatype_size(type);
681+
size_t align = jl_datatype_align(type);
682+
jl_value_t *jv = jl_gc_alloc(ptls, size, align, type);
681683
if (size > 0)
682684
memset(jl_data_ptr(jv), 0, size);
683685
return jv;

src/dump.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,7 +1703,7 @@ static jl_value_t *jl_deserialize_value_method(jl_serializer_state *s, jl_value_
17031703
{
17041704
int usetable = (s->mode != MODE_AST);
17051705
jl_method_t *m =
1706-
(jl_method_t*)jl_gc_alloc(s->ptls, sizeof(jl_method_t),
1706+
(jl_method_t*)jl_gc_alloc(s->ptls, sizeof(jl_method_t), /*align*/ 0,
17071707
jl_method_type);
17081708
memset(m, 0, sizeof(jl_method_type));
17091709
uintptr_t pos = backref_list.len;
@@ -1766,7 +1766,7 @@ static jl_value_t *jl_deserialize_value_method_instance(jl_serializer_state *s,
17661766
{
17671767
int usetable = (s->mode != MODE_AST);
17681768
jl_method_instance_t *li =
1769-
(jl_method_instance_t*)jl_gc_alloc(s->ptls, sizeof(jl_method_instance_t),
1769+
(jl_method_instance_t*)jl_gc_alloc(s->ptls, sizeof(jl_method_instance_t), /*align*/ 0,
17701770
jl_method_instance_type);
17711771
memset(li, 0, sizeof(jl_method_instance_t));
17721772
uintptr_t pos = backref_list.len;
@@ -1928,7 +1928,7 @@ static jl_value_t *jl_deserialize_value_singleton(jl_serializer_state *s, jl_val
19281928
jl_datatype_t *dt = (jl_datatype_t*)jl_deserialize_value(s, NULL);
19291929
return dt->instance;
19301930
}
1931-
jl_value_t *v = (jl_value_t*)jl_gc_alloc(s->ptls, 0, NULL);
1931+
jl_value_t *v = (jl_value_t*)jl_gc_alloc(s->ptls, 0, 0, NULL);
19321932
uintptr_t pos = backref_list.len;
19331933
arraylist_push(&backref_list, (void*)v);
19341934
if (s->mode == MODE_MODULE) {
@@ -1984,7 +1984,9 @@ static jl_value_t *jl_deserialize_typemap_entry(jl_serializer_state *s)
19841984
jl_value_t *te = jl_nothing;
19851985
jl_value_t **pn = &te;
19861986
while (n > 0) {
1987-
jl_value_t *v = jl_gc_alloc(s->ptls, jl_datatype_size(jl_typemap_entry_type), jl_typemap_entry_type);
1987+
jl_value_t *v = jl_gc_alloc(s->ptls, jl_datatype_size(jl_typemap_entry_type),
1988+
jl_datatype_align(jl_typemap_entry_type),
1989+
jl_typemap_entry_type);
19881990
if (n == N && s->mode != MODE_AST)
19891991
arraylist_push(&backref_list, v);
19901992
jl_deserialize_struct(s, v, 1);
@@ -2000,7 +2002,7 @@ static jl_value_t *jl_deserialize_value_any(jl_serializer_state *s, jl_value_t *
20002002
{
20012003
int usetable = (s->mode != MODE_AST);
20022004
int32_t sz = (vtag == (jl_value_t*)SmallDataType_tag ? read_uint8(s->s) : read_int32(s->s));
2003-
jl_value_t *v = jl_gc_alloc(s->ptls, sz, NULL);
2005+
jl_value_t *v = jl_gc_alloc(s->ptls, sz, 0, NULL);
20042006
jl_set_typeof(v, (void*)(intptr_t)0x50);
20052007
uintptr_t pos = backref_list.len;
20062008
if (usetable)
@@ -2081,7 +2083,7 @@ static jl_value_t *jl_deserialize_value_(jl_serializer_state *s, jl_value_t *vta
20812083
return jl_deserialize_value_expr(s, vtag);
20822084
}
20832085
else if (vtag == (jl_value_t*)jl_tvar_type) {
2084-
jl_tvar_t *tv = (jl_tvar_t*)jl_gc_alloc(s->ptls, sizeof(jl_tvar_t), jl_tvar_type);
2086+
jl_tvar_t *tv = (jl_tvar_t*)jl_gc_alloc(s->ptls, sizeof(jl_tvar_t), 0, jl_tvar_type);
20852087
if (usetable)
20862088
arraylist_push(&backref_list, tv);
20872089
tv->name = (jl_sym_t*)jl_deserialize_value(s, NULL);
@@ -2786,7 +2788,7 @@ JL_DLLEXPORT jl_code_info_t *jl_uncompress_ast(jl_method_t *m, jl_array_t *data)
27862788
};
27872789

27882790
jl_code_info_t *code =
2789-
(jl_code_info_t*)jl_gc_alloc(ptls, sizeof(jl_code_info_t),
2791+
(jl_code_info_t*)jl_gc_alloc(ptls, sizeof(jl_code_info_t), 0,
27902792
jl_code_info_type);
27912793
uint8_t flags = read_uint8(s.s);
27922794
code->inferred = !!(flags & (1 << 3));

src/gc.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ static inline int maybe_collect(jl_ptls_t ptls)
661661
JL_DLLEXPORT jl_weakref_t *jl_gc_new_weakref_th(jl_ptls_t ptls,
662662
jl_value_t *value)
663663
{
664-
jl_weakref_t *wr = (jl_weakref_t*)jl_gc_alloc(ptls, sizeof(void*),
664+
jl_weakref_t *wr = (jl_weakref_t*)jl_gc_alloc(ptls, sizeof(void*), 0,
665665
jl_weakref_type);
666666
wr->value = value; // NOTE: wb not needed here
667667
arraylist_push(&ptls->heap.weak_refs, wr);
@@ -2571,9 +2571,9 @@ void gc_mark_queue_all_roots(jl_ptls_t ptls, gc_mark_sp_t *sp)
25712571

25722572
// allocator entry points
25732573

2574-
JL_DLLEXPORT jl_value_t *(jl_gc_alloc)(jl_ptls_t ptls, size_t sz, void *ty)
2574+
JL_DLLEXPORT jl_value_t *(jl_gc_alloc)(jl_ptls_t ptls, size_t sz, size_t alignment, void *ty)
25752575
{
2576-
return jl_gc_alloc_(ptls, sz, ty);
2576+
return jl_gc_alloc_(ptls, sz, alignment, ty);
25772577
}
25782578

25792579
// Per-thread initialization
@@ -2893,31 +2893,31 @@ JL_DLLEXPORT jl_weakref_t *jl_gc_new_weakref(jl_value_t *value)
28932893
JL_DLLEXPORT jl_value_t *jl_gc_allocobj(size_t sz)
28942894
{
28952895
jl_ptls_t ptls = jl_get_ptls_states();
2896-
return jl_gc_alloc(ptls, sz, NULL);
2896+
return jl_gc_alloc(ptls, sz, /*align*/ 0, NULL);
28972897
}
28982898

28992899
JL_DLLEXPORT jl_value_t *jl_gc_alloc_0w(void)
29002900
{
29012901
jl_ptls_t ptls = jl_get_ptls_states();
2902-
return jl_gc_alloc(ptls, 0, NULL);
2902+
return jl_gc_alloc(ptls, 0, 0, NULL);
29032903
}
29042904

29052905
JL_DLLEXPORT jl_value_t *jl_gc_alloc_1w(void)
29062906
{
29072907
jl_ptls_t ptls = jl_get_ptls_states();
2908-
return jl_gc_alloc(ptls, sizeof(void*), NULL);
2908+
return jl_gc_alloc(ptls, sizeof(void*), 0, NULL);
29092909
}
29102910

29112911
JL_DLLEXPORT jl_value_t *jl_gc_alloc_2w(void)
29122912
{
29132913
jl_ptls_t ptls = jl_get_ptls_states();
2914-
return jl_gc_alloc(ptls, sizeof(void*) * 2, NULL);
2914+
return jl_gc_alloc(ptls, sizeof(void*) * 2, 0, NULL);
29152915
}
29162916

29172917
JL_DLLEXPORT jl_value_t *jl_gc_alloc_3w(void)
29182918
{
29192919
jl_ptls_t ptls = jl_get_ptls_states();
2920-
return jl_gc_alloc(ptls, sizeof(void*) * 3, NULL);
2920+
return jl_gc_alloc(ptls, sizeof(void*) * 3, 0, NULL);
29212921
}
29222922

29232923
#ifdef __cplusplus

src/interpreter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ static jl_value_t *eval(jl_value_t *e, interpreter_state *s)
472472
}
473473
jl_compute_field_offsets(dt);
474474
if (para == (jl_value_t*)jl_emptysvec && jl_is_datatype_make_singleton(dt)) {
475-
dt->instance = jl_gc_alloc(ptls, 0, dt);
475+
dt->instance = jl_gc_alloc(ptls, 0, 0, dt);
476476
jl_gc_wb(dt, dt->instance);
477477
}
478478

src/jltypes.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ JL_DLLEXPORT jl_tvar_t *jl_new_typevar(jl_sym_t *name, jl_value_t *lb, jl_value_
446446
if ((ub != (jl_value_t*)jl_any_type && !jl_is_type(ub) && !jl_is_typevar(ub)) || jl_is_vararg_type(ub))
447447
jl_type_error_rt("TypeVar", "upper bound", (jl_value_t*)jl_type_type, ub);
448448
jl_ptls_t ptls = jl_get_ptls_states();
449-
jl_tvar_t *tv = (jl_tvar_t*)jl_gc_alloc(ptls, sizeof(jl_tvar_t), jl_tvar_type);
449+
jl_tvar_t *tv = (jl_tvar_t*)jl_gc_alloc(ptls, sizeof(jl_tvar_t), /*align*/ 0, jl_tvar_type);
450450
tv->name = name;
451451
tv->lb = lb;
452452
tv->ub = ub;
@@ -1154,7 +1154,7 @@ static jl_value_t *inst_datatype(jl_datatype_t *dt, jl_svec_t *p, jl_value_t **i
11541154
ndt->layout = dt->layout;
11551155
ndt->types = jl_emptysvec;
11561156
if (jl_is_datatype_make_singleton(ndt)) {
1157-
ndt->instance = jl_gc_alloc(ptls, 0, ndt);
1157+
ndt->instance = jl_gc_alloc(ptls, 0, 0, ndt);
11581158
jl_gc_wb(ndt, ndt->instance);
11591159
}
11601160
}
@@ -1175,7 +1175,7 @@ static jl_value_t *inst_datatype(jl_datatype_t *dt, jl_svec_t *p, jl_value_t **i
11751175
if (cacheable) {
11761176
jl_compute_field_offsets(ndt);
11771177
if (jl_is_datatype_make_singleton(ndt)) {
1178-
ndt->instance = jl_gc_alloc(ptls, 0, ndt);
1178+
ndt->instance = jl_gc_alloc(ptls, 0, 0, ndt);
11791179
jl_gc_wb(ndt, ndt->instance);
11801180
}
11811181
}
@@ -1503,7 +1503,7 @@ void jl_reinstantiate_inner_types(jl_datatype_t *t) // can throw!
15031503
if (ndt->uid) { // cacheable
15041504
jl_compute_field_offsets(ndt);
15051505
if (jl_is_datatype_make_singleton(ndt)) {
1506-
ndt->instance = jl_gc_alloc(ptls, 0, ndt);
1506+
ndt->instance = jl_gc_alloc(ptls, 0, 0, ndt);
15071507
jl_gc_wb(ndt, ndt->instance);
15081508
}
15091509
}

0 commit comments

Comments
 (0)