Skip to content

Commit

Permalink
runtime: we should never gc the main thread, workaround fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
  • Loading branch information
Jafaral committed Feb 22, 2024
1 parent efc6026 commit f87e9ee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/runtime/rmemmgt.r
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ static void reclaim()
*/
compact(blkbase);
}
/*
* cofree - collect co-expression blocks. This is done after
* the marking phase of garbage collection and the stacks that are
Expand Down Expand Up @@ -1535,6 +1535,8 @@ static void cofree()
xep = *ep;
*ep = (*ep)->nextstk;
if (xep->program == &rootpstate || xep->id == 1)
continue;
/*
* Free the astkblks. There should always be one and it seems that
* it's not possible to have more than one, but nonetheless, the
Expand All @@ -1547,12 +1549,12 @@ static void cofree()
free((pointer)xabp);
#if 0
else
fprintf(stderr,"Warning: internal gc error: activator list is not empty.\n");
fprintf(stderr,"Warning: internal gc error: activator list is not empty.\n");
#endif
} /* for abp */

#ifdef CoClean
coclean(xep);
coclean(xep);
#endif /* CoClean */

free((pointer)xep);
Expand All @@ -1563,7 +1565,7 @@ static void cofree()
}
}
}


/*
* scollect - collect the string space. quallist is a list of pointers to
* descriptors for all the reachable strings in the string space. For
Expand Down

0 comments on commit f87e9ee

Please sign in to comment.