@@ -483,9 +483,9 @@ DbSlice::AutoUpdater::~AutoUpdater() {
483483}
484484
485485void DbSlice::AutoUpdater::ReduceHeapUsage () {
486- AccountObjectMemory (fields_.key , fields_.it ->second .ObjType (), -fields_.orig_heap_size ,
486+ AccountObjectMemory (fields_.key , fields_.it ->second .ObjType (), -fields_.orig_value_heap_size ,
487487 fields_.db_slice ->GetDBTable (fields_.db_ind ));
488- fields_.orig_heap_size = 0 ; // Reset to avoid double accounting.
488+ fields_.orig_value_heap_size = 0 ; // Reset to avoid double accounting.
489489}
490490
491491void DbSlice::AutoUpdater::Run () {
@@ -501,7 +501,7 @@ void DbSlice::AutoUpdater::Run() {
501501 CHECK_NE (fields_.db_slice , nullptr );
502502
503503 ssize_t delta = static_cast <int64_t >(fields_.it ->second .MallocUsed ()) -
504- static_cast <int64_t >(fields_.orig_heap_size );
504+ static_cast <int64_t >(fields_.orig_value_heap_size );
505505 AccountObjectMemory (fields_.key , fields_.it ->second .ObjType (), delta,
506506 fields_.db_slice ->GetDBTable (fields_.db_ind ));
507507 fields_.db_slice ->PostUpdate (fields_.db_ind , fields_.key );
@@ -518,7 +518,7 @@ DbSlice::AutoUpdater::AutoUpdater(DbIndex db_ind, std::string_view key, const It
518518 .db_ind = db_ind,
519519 .it = it,
520520 .key = key,
521- .orig_heap_size = it->second .MallocUsed ()} {
521+ .orig_value_heap_size = it->second .MallocUsed ()} {
522522 DCHECK (IsValid (it));
523523}
524524
@@ -770,7 +770,7 @@ OpResult<DbSlice::ItAndUpdater> DbSlice::AddOrFindInternal(const Context& cntx,
770770 if (it->first .IsInline ()) {
771771 ++db.stats .inline_keys ;
772772 } else {
773- AccountObjectMemory (key, it-> first . ObjType () , it->first .MallocUsed (), &db); // Account for key
773+ AccountObjectMemory (key, OBJ_KEY , it->first .MallocUsed (), &db); // Account for key
774774 }
775775
776776 DCHECK_EQ (it->second .MallocUsed (), 0UL ); // Make sure accounting is no-op
@@ -1553,7 +1553,7 @@ void DbSlice::InvalidateSlotWatches(const cluster::SlotSet& slot_ids) {
15531553}
15541554
15551555void DbSlice::RemoveOffloadedEntriesFromTieredStorage (absl::Span<const DbIndex> indices,
1556- const DbTableArray& db_arr) {
1556+ const DbTableArray& db_arr) const {
15571557 // Currently being used only for tiered storage.
15581558 TieredStorage* tiered_storage = shard_owner ()->tiered_storage ();
15591559 string scratch;
@@ -1787,8 +1787,7 @@ void DbSlice::PerformDeletionAtomic(const Iterator& del_it, const ExpIterator& e
17871787 if (del_it->first .IsInline ()) {
17881788 --stats.inline_keys ;
17891789 } else {
1790- AccountObjectMemory (del_it.key (), del_it->first .ObjType (), -key_size_used,
1791- table); // Key
1790+ AccountObjectMemory (del_it.key (), OBJ_KEY, -key_size_used, table); // Key
17921791 }
17931792 AccountObjectMemory (del_it.key (), pv.ObjType (), -value_heap_size, table); // Value
17941793
0 commit comments