Skip to content

Commit

Permalink
Update page size to 64k
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaraldi committed Jul 19, 2023
1 parent 0f56da8 commit 01a0f4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
extern "C" {
#endif

#define GC_PAGE_LG2 14 // log2(size of a page)
#define GC_PAGE_SZ (1 << GC_PAGE_LG2) // 16k
#define GC_PAGE_LG2 16 // log2(size of a page)
#define GC_PAGE_SZ (1 << GC_PAGE_LG2) // 64k
#define GC_PAGE_OFFSET (JL_HEAP_ALIGNMENT - (sizeof(jl_taggedvalue_t) % JL_HEAP_ALIGNMENT))

#define jl_malloc_tag ((void*)0xdeadaa01)
Expand Down Expand Up @@ -233,14 +233,14 @@ STATIC_INLINE jl_gc_pagemeta_t *pop_lf_page_metadata_back(jl_gc_global_page_pool
#define REGION0_PG_COUNT (1 << 16)
#define REGION1_PG_COUNT (1 << 16)
#define REGION2_PG_COUNT (1 << 18)
#define REGION0_INDEX(p) (((uintptr_t)(p) >> 14) & 0xFFFF) // shift by GC_PAGE_LG2
#define REGION0_INDEX(p) (((uintptr_t)(p) >> GC_PAGE_LG2) & 0xFFFF) // shift by GC_PAGE_LG2
#define REGION1_INDEX(p) (((uintptr_t)(p) >> 30) & 0xFFFF)
#define REGION_INDEX(p) (((uintptr_t)(p) >> 46) & 0x3FFFF)
#else
#define REGION0_PG_COUNT (1 << 8)
#define REGION1_PG_COUNT (1 << 10)
#define REGION2_PG_COUNT (1 << 0)
#define REGION0_INDEX(p) (((uintptr_t)(p) >> 14) & 0xFF) // shift by GC_PAGE_LG2
#define REGION0_INDEX(p) (((uintptr_t)(p) >> GC_PAGE_LG2) & 0xFF) // shift by GC_PAGE_LG2
#define REGION1_INDEX(p) (((uintptr_t)(p) >> 22) & 0x3FF)
#define REGION_INDEX(p) (0)
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ void *jl_gc_perm_alloc(size_t sz, int zero,
void gc_sweep_sysimg(void);


// pools are 16376 bytes large (GC_POOL_SZ - GC_PAGE_OFFSET)
// pools are 65528 bytes large (GC_POOL_SZ - GC_PAGE_OFFSET)
// TODO update table for 64k size
static const int jl_gc_sizeclasses[] = {
#ifdef _P64
8,
Expand Down

0 comments on commit 01a0f4a

Please sign in to comment.