Skip to content

Commit

Permalink
bugfix rare infinite loop in gc
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Dec 1, 2016
1 parent daa4592 commit 4b69c77
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,14 +418,13 @@ static void *gc_alloc_var( int part, int size, int kind ) {
if( p->sizes[next] == 0 ) hl_fatal("assert");
# endif
next += p->sizes[next];
if( (next>>5) != fid ) {
if( next + nblocks > p->max_blocks ) {
p->next_block = next;
p = p->next_page;
goto loop;
}
continue;
if( next + nblocks > p->max_blocks ) {
p->next_block = next;
p = p->next_page;
goto loop;
}
if( (next>>5) != fid )
continue;
goto resume;
}
bits = TRAILING_ZEROES( (next & 31) ? (fetch_bits >> (next&31)) | (1<<(32-(next&31))) : fetch_bits );
Expand Down

0 comments on commit 4b69c77

Please sign in to comment.