Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Aug 19, 2023
1 parent 9a096ab commit 8641487
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static gc_pheader *gc_allocator_new_page( int pid, int block, int size, int kind
if( p->max_blocks > GC_PAGE_SIZE )
hl_fatal("Too many blocks for this page");
if( varsize ) {
if( p->max_blocks <= 8 )
if( p->max_blocks <= SIZES_PADDING )
p->sizes = (unsigned char*)&p->sizes_ref;
else {
p->sizes = ph->base + start_pos;
Expand Down
5 changes: 3 additions & 2 deletions src/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ typedef struct _gc_freelist {
gc_fl *data;
} gc_freelist;

#define SIZES_PADDING 8

typedef struct {
int block_size;
unsigned char size_bits;
Expand All @@ -22,7 +24,6 @@ typedef struct {
// mutable
gc_freelist free;
unsigned char *sizes;
int sizes_ref;
int sizes_ref2;
char sizes_ref[SIZES_PADDING];
} gc_allocator_page_data;

0 comments on commit 8641487

Please sign in to comment.