Skip to content

Commit abf3b60

Browse files
committed
Fix deprecation warning in CacheAllocator
1 parent 4df22c7 commit abf3b60

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cachelib/allocator/CacheAllocator-inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ CacheAllocator<CacheTrait>::moveRegularItemWithSync(
12811281
// should be fine for it to be left in an inconsistent state.
12821282
config_.moveCb(oldItem, *newItemHdl, nullptr);
12831283
} else {
1284-
std::memcpy(newItemHdl->getWritableMemory(), oldItem.getMemory(),
1284+
std::memcpy(newItemHdl->getMemory(), oldItem.getMemory(),
12851285
oldItem.getSize());
12861286
}
12871287

cachelib/allocator/tests/BaseAllocatorTest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6073,7 +6073,7 @@ class BaseAllocatorTest : public AllocatorTest<AllocatorT> {
60736073

60746074
std::set<std::string> movedKeys;
60756075
auto moveCb = [&](const Item& oldItem, Item& newItem, Item* /* parentPtr */) {
6076-
std::memcpy(newItem.getWritableMemory(), oldItem.getMemory(), oldItem.getSize());
6076+
std::memcpy(newItem.getMemory(), oldItem.getMemory(), oldItem.getSize());
60776077
movedKeys.insert(oldItem.getKey().str());
60786078
};
60796079

@@ -6103,7 +6103,7 @@ class BaseAllocatorTest : public AllocatorTest<AllocatorT> {
61036103
auto h = alloc.allocate(pid, key, 1024);
61046104
EXPECT_TRUE(h);
61056105

6106-
std::memcpy(h->getWritableMemory(), data.data(), data.size());
6106+
std::memcpy(h->getMemory(), data.data(), data.size());
61076107

61086108
alloc.insertOrReplace(h);
61096109
}

0 commit comments

Comments
 (0)