Skip to content

Commit

Permalink
Remove assumption in gc that MAX_ALIGN can only be as high as 8 (#55195)
Browse files Browse the repository at this point in the history
Split out from #54848 where this is necessary as `MAX_ALIGN` is now 16
on x86. Similar change to #34554.
  • Loading branch information
Zentrik authored Jul 21, 2024
1 parent 43df7fb commit 775c0da
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,15 +405,15 @@ static const int jl_gc_sizeclasses[] = {
#ifdef GC_SMALL_PAGE
#ifdef _P64
# define JL_GC_N_POOLS 39
#elif MAX_ALIGN == 8
#elif MAX_ALIGN > 4
# define JL_GC_N_POOLS 40
#else
# define JL_GC_N_POOLS 41
#endif
#else
#ifdef _P64
# define JL_GC_N_POOLS 49
#elif MAX_ALIGN == 8
#elif MAX_ALIGN > 4
# define JL_GC_N_POOLS 50
#else
# define JL_GC_N_POOLS 51
Expand All @@ -428,7 +428,7 @@ STATIC_INLINE int jl_gc_alignment(size_t sz) JL_NOTSAFEPOINT
#ifdef _P64
(void)sz;
return 16;
#elif MAX_ALIGN == 8
#elif MAX_ALIGN > 4
return sz <= 4 ? 8 : 16;
#else
// szclass 8
Expand Down Expand Up @@ -460,7 +460,7 @@ STATIC_INLINE uint8_t JL_CONST_FUNC jl_gc_szclass(unsigned sz) JL_NOTSAFEPOINT
if (sz <= 8)
return 0;
const int N = 0;
#elif MAX_ALIGN == 8
#elif MAX_ALIGN > 4
if (sz <= 8)
return (sz >= 4 ? 1 : 0);
const int N = 1;
Expand All @@ -478,7 +478,7 @@ STATIC_INLINE uint8_t JL_CONST_FUNC jl_gc_szclass_align8(unsigned sz) JL_NOTSAFE
if (sz >= 16 && sz <= 152) {
#ifdef _P64
const int N = 0;
#elif MAX_ALIGN == 8
#elif MAX_ALIGN > 4
const int N = 1;
#else
const int N = 2;
Expand Down

0 comments on commit 775c0da

Please sign in to comment.