Skip to content

Commit

Permalink
Merge pull request JuliaLang#17598 from JuliaLang/yyc/arm/align
Browse files Browse the repository at this point in the history
Remove sizeclass 12 on ARM and PPC32.
  • Loading branch information
yuyichao committed Jul 25, 2016
2 parents 0d7c014 + 1857f07 commit 194f996
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <setjmp.h>
#ifndef _OS_WINDOWS_
# define jl_jmp_buf sigjmp_buf
# if defined(_CPU_ARM_)
# if defined(_CPU_ARM_) || defined(_CPU_PPC_)
# define MAX_ALIGN 8
# elif defined(_CPU_AARCH64_)
// int128 is 16 bytes aligned on aarch64
Expand Down
8 changes: 8 additions & 0 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ void *jl_gc_perm_alloc(size_t sz);
static const int jl_gc_sizeclasses[JL_GC_N_POOLS] = {
#ifdef _P64
8,
#elif defined(_CPU_ARM_) || defined(_CPU_PPC_)
// ARM and PowerPC has max alignment of 8,
// make sure allocation of size 8 has that alignment.
4, 8,
#else
4, 8, 12,
#endif
Expand Down Expand Up @@ -87,6 +91,10 @@ STATIC_INLINE int JL_CONST_FUNC jl_gc_szclass(size_t sz)
if (sz <= 8)
return 0;
const int N = 0;
#elif defined(_CPU_ARM_) || defined(_CPU_PPC_)
if (sz <= 8)
return (sz + 3) / 4 - 1;
const int N = 1;
#else
if (sz <= 12)
return (sz + 3) / 4 - 1;
Expand Down
6 changes: 4 additions & 2 deletions src/julia_threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ typedef struct {

// variables for allocating objects from pools
#ifdef _P64
#define JL_GC_N_POOLS 41
# define JL_GC_N_POOLS 41
#elif defined(_CPU_ARM_) || defined(_CPU_PPC_)
# define JL_GC_N_POOLS 42
#else
#define JL_GC_N_POOLS 43
# define JL_GC_N_POOLS 43
#endif
jl_gc_pool_t norm_pools[JL_GC_N_POOLS];
} jl_thread_heap_t;
Expand Down

0 comments on commit 194f996

Please sign in to comment.