Skip to content

Commit

Permalink
remove a bunch of bit unnecessary bit clearing in bigval's sz field
Browse files Browse the repository at this point in the history
  • Loading branch information
d-netto committed Jun 27, 2024
1 parent 4e1fd72 commit 71e5360
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,11 @@ STATIC_INLINE void gc_setmark_big(jl_ptls_t ptls, jl_taggedvalue_t *o,
assert(!gc_alloc_map_is_set((char*)o));
bigval_t *hdr = bigval_header(o);
if (mark_mode == GC_OLD_MARKED) {
ptls->gc_cache.perm_scanned_bytes += hdr->sz & ~3;
ptls->gc_cache.perm_scanned_bytes += hdr->sz;
gc_queue_big_marked(ptls, hdr, 0);
}
else {
ptls->gc_cache.scanned_bytes += hdr->sz & ~3;
ptls->gc_cache.scanned_bytes += hdr->sz;
// We can't easily tell if the object is old or being promoted
// from the gc bits but if the `age` is `0` then the object
// must be already on a young list.
Expand All @@ -846,7 +846,7 @@ STATIC_INLINE void gc_setmark_big(jl_ptls_t ptls, jl_taggedvalue_t *o,
}
}
objprofile_count(jl_typeof(jl_valueof(o)),
mark_mode == GC_OLD_MARKED, hdr->sz & ~3);
mark_mode == GC_OLD_MARKED, hdr->sz);
}

// This function should be called exactly once during marking for each pool
Expand Down Expand Up @@ -1075,11 +1075,11 @@ static bigval_t **sweep_big_list(int sweep_full, bigval_t **pv) JL_NOTSAFEPOINT
*pv = nxt;
if (nxt)
nxt->prev = pv;
gc_num.freed += v->sz&~3;
gc_num.freed += v->sz;
jl_atomic_store_relaxed(&gc_heap_stats.heap_size,
jl_atomic_load_relaxed(&gc_heap_stats.heap_size) - (v->sz&~3));
jl_atomic_load_relaxed(&gc_heap_stats.heap_size) - (v->sz));
#ifdef MEMDEBUG
memset(v, 0xbb, v->sz&~3);
memset(v, 0xbb, v->sz);
#endif
gc_invoke_callbacks(jl_gc_cb_notify_external_free_t,
gc_cblist_notify_external_free, (v));
Expand Down

0 comments on commit 71e5360

Please sign in to comment.