Skip to content

Commit 4564134

Browse files
authored
remove a bunch of bit unnecessary bit clearing in bigval's sz field (#54946)
We don't store anything in the lowest two bits of `sz` after #49644.
1 parent 06e81bc commit 4564134

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/gc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -832,11 +832,11 @@ STATIC_INLINE void gc_setmark_big(jl_ptls_t ptls, jl_taggedvalue_t *o,
832832
assert(!gc_alloc_map_is_set((char*)o));
833833
bigval_t *hdr = bigval_header(o);
834834
if (mark_mode == GC_OLD_MARKED) {
835-
ptls->gc_cache.perm_scanned_bytes += hdr->sz & ~3;
835+
ptls->gc_cache.perm_scanned_bytes += hdr->sz;
836836
gc_queue_big_marked(ptls, hdr, 0);
837837
}
838838
else {
839-
ptls->gc_cache.scanned_bytes += hdr->sz & ~3;
839+
ptls->gc_cache.scanned_bytes += hdr->sz;
840840
// We can't easily tell if the object is old or being promoted
841841
// from the gc bits but if the `age` is `0` then the object
842842
// must be already on a young list.
@@ -846,7 +846,7 @@ STATIC_INLINE void gc_setmark_big(jl_ptls_t ptls, jl_taggedvalue_t *o,
846846
}
847847
}
848848
objprofile_count(jl_typeof(jl_valueof(o)),
849-
mark_mode == GC_OLD_MARKED, hdr->sz & ~3);
849+
mark_mode == GC_OLD_MARKED, hdr->sz);
850850
}
851851

852852
// This function should be called exactly once during marking for each pool
@@ -1075,11 +1075,11 @@ static bigval_t **sweep_big_list(int sweep_full, bigval_t **pv) JL_NOTSAFEPOINT
10751075
*pv = nxt;
10761076
if (nxt)
10771077
nxt->prev = pv;
1078-
gc_num.freed += v->sz&~3;
1078+
gc_num.freed += v->sz;
10791079
jl_atomic_store_relaxed(&gc_heap_stats.heap_size,
1080-
jl_atomic_load_relaxed(&gc_heap_stats.heap_size) - (v->sz&~3));
1080+
jl_atomic_load_relaxed(&gc_heap_stats.heap_size) - (v->sz));
10811081
#ifdef MEMDEBUG
1082-
memset(v, 0xbb, v->sz&~3);
1082+
memset(v, 0xbb, v->sz);
10831083
#endif
10841084
gc_invoke_callbacks(jl_gc_cb_notify_external_free_t,
10851085
gc_cblist_notify_external_free, (v));

0 commit comments

Comments
 (0)