diff --git a/src/snmalloc/mem/localalloc.h b/src/snmalloc/mem/localalloc.h index f83783ca3..85d7b723f 100644 --- a/src/snmalloc/mem/localalloc.h +++ b/src/snmalloc/mem/localalloc.h @@ -285,7 +285,7 @@ namespace snmalloc address_cast(entry.get_slab_metadata())); #endif local_cache.remote_dealloc_cache.template dealloc( - entry.get_slab_metadata(), entry.get_remote()->trunc_id(), p); + entry.get_slab_metadata(), p); post_remote_cache(); return; } @@ -678,7 +678,7 @@ namespace snmalloc if (local_cache.remote_dealloc_cache.reserve_space(entry)) { local_cache.remote_dealloc_cache.template dealloc( - entry.get_slab_metadata(), remote->trunc_id(), p_tame); + entry.get_slab_metadata(), p_tame); # ifdef SNMALLOC_TRACING message<1024>( "Remote dealloc fast {} ({}, {})", diff --git a/src/snmalloc/mem/remotecache.h b/src/snmalloc/mem/remotecache.h index 276988032..6ed883f48 100644 --- a/src/snmalloc/mem/remotecache.h +++ b/src/snmalloc/mem/remotecache.h @@ -29,7 +29,6 @@ namespace snmalloc std::array, RINGS> open_builder; std::array open_meta = {nullptr}; - std::array open_target = {0}; /** * The total amount of memory we are waiting for before we will dispatch @@ -97,20 +96,19 @@ namespace snmalloc freelist::Object::key_root, open_meta[ix]->as_key_tweak()); - forward(open_target[ix], rmsg); + auto& entry = Config::Backend::get_metaentry(address_cast(rmsg)); + + forward(entry.get_remote()->trunc_id(), rmsg); open_meta[ix] = nullptr; } SNMALLOC_FAST_PATH void init_one_pending( - size_t ix, - typename Config::PagemapEntry::SlabMetadata* meta, - RemoteAllocator::alloc_id_t id) + size_t ix, typename Config::PagemapEntry::SlabMetadata* meta) { open_builder[ix].init( 0, freelist::Object::key_root, open_meta[ix]->as_key_tweak()); open_meta[ix] = meta; - open_target[ix] = id; } SNMALLOC_FAST_PATH size_t @@ -123,9 +121,7 @@ namespace snmalloc template SNMALLOC_FAST_PATH void dealloc( - typename Config::PagemapEntry::SlabMetadata* meta, - RemoteAllocator::alloc_id_t target_id, - capptr::Alloc p) + typename Config::PagemapEntry::SlabMetadata* meta, capptr::Alloc p) { SNMALLOC_ASSERT(initialised); @@ -167,7 +163,7 @@ namespace snmalloc { close_one_pending(victim_ix); } - init_one_pending(victim_ix, meta, target_id); + init_one_pending(victim_ix, meta); open_builder[victim_ix].add( r, freelist::Object::key_root, meta->as_key_tweak());