Skip to content

Commit 2ab7f95

Browse files
committed
Small fixup
1 parent b033c0a commit 2ab7f95

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/gc.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3659,10 +3659,7 @@ JL_DLLEXPORT void *jl_gc_counted_realloc_with_old_size(void *p, size_t old, size
36593659
if (pgcstack != NULL && ct->world_age) {
36603660
jl_ptls_t ptls = ct->ptls;
36613661
maybe_collect(ptls);
3662-
if (sz < old)
3663-
jl_atomic_store_relaxed(&ptls->gc_num.freed,
3664-
jl_atomic_load_relaxed(&ptls->gc_num.freed) + (old - sz));
3665-
else
3662+
if (!(sz < old))
36663663
jl_atomic_store_relaxed(&ptls->gc_num.allocd,
36673664
jl_atomic_load_relaxed(&ptls->gc_num.allocd) + (sz - old));
36683665
jl_atomic_store_relaxed(&ptls->gc_num.realloc,
@@ -3773,10 +3770,7 @@ static void *gc_managed_realloc_(jl_ptls_t ptls, void *d, size_t sz, size_t olds
37733770
ptls->gc_cache.perm_scanned_bytes += allocsz - oldsz;
37743771
inc_live_bytes(allocsz - oldsz);
37753772
}
3776-
else if (allocsz < oldsz)
3777-
jl_atomic_store_relaxed(&ptls->gc_num.freed,
3778-
jl_atomic_load_relaxed(&ptls->gc_num.freed) + (oldsz - allocsz));
3779-
else
3773+
else if (!(allocsz < oldsz))
37803774
jl_atomic_store_relaxed(&ptls->gc_num.allocd,
37813775
jl_atomic_load_relaxed(&ptls->gc_num.allocd) + (allocsz - oldsz));
37823776
jl_atomic_store_relaxed(&ptls->gc_num.realloc,

0 commit comments

Comments
 (0)