Skip to content

Commit

Permalink
concurrent sweeping --merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
d-netto committed Aug 6, 2023
1 parent 7dede67 commit 1df3b28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3160,6 +3160,14 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection)
JL_PROBE_GC_MARK_BEGIN();
uint64_t start_mark_time = jl_hrtime();

// 1. fix GC bits of objects in the remset.
assert(gc_n_threads);
for (int t_i = 0; t_i < gc_n_threads; t_i++) {
jl_ptls_t ptls2 = gc_all_tls_states[t_i];
if (ptls2 != NULL)
gc_premark(ptls2);
}

assert(gc_n_threads);
int single_threaded = (jl_n_gcthreads == 0 || gc_heap_snapshot_enabled);
for (int t_i = 0; t_i < gc_n_threads; t_i++) {
Expand Down
7 changes: 0 additions & 7 deletions src/jloptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,13 +849,6 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
else
jl_errorf("julia: invalid argument to --permalloc-pkgimg={yes|no} (%s)", optarg);
break;
case opt_gc_threads:
errno = 0;
long ngcthreads = strtol(optarg, &endptr, 10);
if (errno != 0 || optarg == endptr || *endptr != 0 || ngcthreads < 1 || ngcthreads >= INT16_MAX)
jl_errorf("julia: --gcthreads=<n>; n must be an integer >= 1");
jl_options.ngcthreads = (int16_t)ngcthreads;
break;
default:
jl_errorf("julia: unhandled option -- %c\n"
"This is a bug, please report it.", c);
Expand Down

0 comments on commit 1df3b28

Please sign in to comment.