Skip to content

Commit cdf6716

Browse files
committed
Fix inflight statistic
1 parent c96a5e0 commit cdf6716

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/snmalloc/mem/corealloc.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,10 @@ namespace snmalloc
526526
entry.get_slab_metadata()->as_key_tweak(),
527527
domesticate);
528528

529+
// Need to account for forwarded bytes.
530+
size_t size = nelem * sizeclass_full_to_size(entry.get_sizeclass());
531+
bytes_returned += size;
532+
529533
need_post |= remote_dealloc_cache.reserve_space(entry, nelem);
530534

531535
remote_dealloc_cache.template forward<sizeof(Allocator)>(
@@ -1395,10 +1399,10 @@ namespace snmalloc
13951399
return capptr_domesticate<Config>(local_state, p);
13961400
};
13971401

1398-
size_t bytes_flushed = 0;
1399-
14001402
if (destroy_queue)
14011403
{
1404+
size_t bytes_flushed = 0;
1405+
14021406
auto cb =
14031407
[this, domesticate, &bytes_flushed](capptr::Alloc<RemoteMessage> m) {
14041408
bool need_post = true; // Always going to post, so ignore.

0 commit comments

Comments
 (0)