Skip to content

Commit 387814b

Browse files
committed
Aligning strings to 8 bytes
1 parent a0e35b5 commit 387814b

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/array.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,7 @@ JL_DLLEXPORT jl_value_t *jl_alloc_string(size_t len)
496496
// the Allocations Profiler. (See https://github.com/JuliaLang/julia/pull/43868 for more details.)
497497
s = jl_gc_pool_alloc_noinline(ptls, (char*)p - (char*)ptls, osize);
498498
#else
499-
int pool_id = jl_gc_szclass_align8(allocsz);
500-
s = jl_mmtk_gc_alloc_default(ptls, allocsz, jl_string_type);
499+
s = jl_mmtk_gc_alloc_default(ptls, allocsz, 8, jl_string_type);
501500
#endif
502501
}
503502
else {

src/julia_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ jl_value_t *jl_gc_pool_alloc_noinline(jl_ptls_t ptls, int pool_offset,
339339
int osize);
340340
jl_value_t *jl_gc_big_alloc_noinline(jl_ptls_t ptls, size_t allocsz);
341341
#ifdef MMTK_GC
342-
JL_DLLIMPORT jl_value_t *jl_mmtk_gc_alloc_default(jl_ptls_t ptls, int osize, void* ty);
342+
JL_DLLIMPORT jl_value_t *jl_mmtk_gc_alloc_default(jl_ptls_t ptls, int osize, size_t align, void* ty);
343343
JL_DLLIMPORT jl_value_t *jl_mmtk_gc_alloc_big(jl_ptls_t ptls, size_t allocsz);
344344
JL_DLLIMPORT extern void mmtk_post_alloc(void* mutator, void* obj, size_t bytes, int allocator);
345345
JL_DLLIMPORT extern void mmtk_initialize_collection(void* tls);
@@ -493,7 +493,7 @@ STATIC_INLINE jl_value_t *jl_gc_alloc_(jl_ptls_t ptls, size_t sz, void *ty)
493493
jl_value_t *v;
494494
const size_t allocsz = sz + sizeof(jl_taggedvalue_t);
495495
if (sz <= GC_MAX_SZCLASS) {
496-
v = jl_mmtk_gc_alloc_default(ptls, allocsz, ty);
496+
v = jl_mmtk_gc_alloc_default(ptls, allocsz, 16, ty);
497497
}
498498
else {
499499
if (allocsz < sz) // overflow in adding offs, size was "negative"

src/mmtk-gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ inline jl_value_t *jl_gc_pool_alloc_inner(jl_ptls_t ptls, int pool_offset, int o
167167
// TODO: drop this okay?
168168
// maybe_collect(ptls);
169169

170-
jl_value_t *v = jl_mmtk_gc_alloc_default(ptls, osize, NULL);
170+
jl_value_t *v = jl_mmtk_gc_alloc_default(ptls, osize, 16, NULL);
171171
// TODO: this is done (without atomic operations) in jl_mmtk_gc_alloc_default; enable
172172
// here when that's edited?
173173
/*

0 commit comments

Comments
 (0)