Skip to content

Commit 19ee5f9

Browse files
committed
pass alignment from the outside jl_gc_alloc
1 parent 541e8de commit 19ee5f9

14 files changed

+83
-82
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;
@@ -451,7 +451,7 @@ static jl_value_t *jl_new_bits_internal(jl_value_t *dt, void *data, size_t *len)
451451
if (bt == jl_int32_type) return jl_box_int32(*(int32_t*)data);
452452
if (bt == jl_float64_type) return jl_box_float64(*(double*)data);
453453

454-
jl_value_t *v = jl_gc_alloc(ptls, nb, bt);
454+
jl_value_t *v = jl_gc_alloc(ptls, nb, jl_datatype_align(bt), bt);
455455
switch (nb) {
456456
case 1: *(int8_t*) jl_data_ptr(v) = *(int8_t*)data; break;
457457
case 2: *(int16_t*) jl_data_ptr(v) = *(int16_t*)data; break;
@@ -489,7 +489,8 @@ void jl_assign_bits(void *dest, jl_value_t *bits)
489489
jl_ptls_t ptls = jl_get_ptls_states(); \
490490
assert(jl_isbits(t)); \
491491
assert(jl_datatype_size(t) == sizeof(x)); \
492-
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), t); \
492+
size_t align = jl_datatype_align(t); \
493+
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), align, t);\
493494
*(int##nb##_t*)jl_data_ptr(v) = x; \
494495
return v; \
495496
} \
@@ -534,7 +535,7 @@ UNBOX_FUNC(voidpointer, void*)
534535
JL_DLLEXPORT jl_value_t *pfx##_##typ(c_type x) \
535536
{ \
536537
jl_ptls_t ptls = jl_get_ptls_states(); \
537-
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), \
538+
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), 0,\
538539
jl_##typ##_type); \
539540
*(c_type*)jl_data_ptr(v) = x; \
540541
return v; \
@@ -557,7 +558,7 @@ BOX_FUNC(float64, double, jl_box, 2)
557558
c_type idx = x+NBOX_C/2; \
558559
if ((u##c_type)idx < (u##c_type)NBOX_C) \
559560
return boxed_##typ##_cache[idx]; \
560-
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), \
561+
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), 0,\
561562
jl_##typ##_type); \
562563
*(c_type*)jl_data_ptr(v) = x; \
563564
return v; \
@@ -569,7 +570,7 @@ BOX_FUNC(float64, double, jl_box, 2)
569570
jl_ptls_t ptls = jl_get_ptls_states(); \
570571
if (x < NBOX_C) \
571572
return boxed_##typ##_cache[x]; \
572-
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), \
573+
jl_value_t *v = jl_gc_alloc(ptls, nw * sizeof(void*), 0,\
573574
jl_##typ##_type); \
574575
*(c_type*)jl_data_ptr(v) = x; \
575576
return v; \
@@ -650,7 +651,7 @@ JL_DLLEXPORT jl_value_t *jl_new_struct(jl_datatype_t *type, ...)
650651
va_list args;
651652
size_t nf = jl_datatype_nfields(type);
652653
va_start(args, type);
653-
jl_value_t *jv = jl_gc_alloc(ptls, jl_datatype_size(type), type);
654+
jl_value_t *jv = jl_gc_alloc(ptls, jl_datatype_size(type), jl_datatype_align(type), type);
654655
for(size_t i=0; i < nf; i++) {
655656
jl_set_nth_field(jv, i, va_arg(args, jl_value_t*));
656657
}
@@ -664,7 +665,7 @@ JL_DLLEXPORT jl_value_t *jl_new_structv(jl_datatype_t *type, jl_value_t **args,
664665
jl_ptls_t ptls = jl_get_ptls_states();
665666
if (type->instance != NULL) return type->instance;
666667
size_t nf = jl_datatype_nfields(type);
667-
jl_value_t *jv = jl_gc_alloc(ptls, jl_datatype_size(type), type);
668+
jl_value_t *jv = jl_gc_alloc(ptls, jl_datatype_size(type), jl_datatype_align(type), type);
668669
for(size_t i=0; i < na; i++) {
669670
jl_set_nth_field(jv, i, args[i]);
670671
}
@@ -680,8 +681,9 @@ JL_DLLEXPORT jl_value_t *jl_new_struct_uninit(jl_datatype_t *type)
680681
{
681682
jl_ptls_t ptls = jl_get_ptls_states();
682683
if (type->instance != NULL) return type->instance;
683-
size_t size = jl_datatype_size(type);
684-
jl_value_t *jv = jl_gc_alloc(ptls, size, type);
684+
size_t size = jl_datatype_size(type);
685+
size_t align = jl_datatype_align(type);
686+
jl_value_t *jv = jl_gc_alloc(ptls, size, align, type);
685687
if (size > 0)
686688
memset(jl_data_ptr(jv), 0, size);
687689
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
@@ -2909,31 +2909,31 @@ JL_DLLEXPORT jl_weakref_t *jl_gc_new_weakref(jl_value_t *value)
29092909
JL_DLLEXPORT jl_value_t *jl_gc_allocobj(size_t sz)
29102910
{
29112911
jl_ptls_t ptls = jl_get_ptls_states();
2912-
return jl_gc_alloc(ptls, sz, NULL);
2912+
return jl_gc_alloc(ptls, sz, /*align*/ 0, NULL);
29132913
}
29142914

29152915
JL_DLLEXPORT jl_value_t *jl_gc_alloc_0w(void)
29162916
{
29172917
jl_ptls_t ptls = jl_get_ptls_states();
2918-
return jl_gc_alloc(ptls, 0, NULL);
2918+
return jl_gc_alloc(ptls, 0, 0, NULL);
29192919
}
29202920

29212921
JL_DLLEXPORT jl_value_t *jl_gc_alloc_1w(void)
29222922
{
29232923
jl_ptls_t ptls = jl_get_ptls_states();
2924-
return jl_gc_alloc(ptls, sizeof(void*), NULL);
2924+
return jl_gc_alloc(ptls, sizeof(void*), 0, NULL);
29252925
}
29262926

29272927
JL_DLLEXPORT jl_value_t *jl_gc_alloc_2w(void)
29282928
{
29292929
jl_ptls_t ptls = jl_get_ptls_states();
2930-
return jl_gc_alloc(ptls, sizeof(void*) * 2, NULL);
2930+
return jl_gc_alloc(ptls, sizeof(void*) * 2, 0, NULL);
29312931
}
29322932

29332933
JL_DLLEXPORT jl_value_t *jl_gc_alloc_3w(void)
29342934
{
29352935
jl_ptls_t ptls = jl_get_ptls_states();
2936-
return jl_gc_alloc(ptls, sizeof(void*) * 3, NULL);
2936+
return jl_gc_alloc(ptls, sizeof(void*) * 3, 0, NULL);
29372937
}
29382938

29392939
#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)