diff options
author | Victor Costan <costan@google.com> | 2022-01-09 23:08:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-09 23:08:24 -0800 |
commit | 3180f9cb402f51ce89be7011b103747bc6462976 (patch) | |
tree | 9671501a3176d0f9fc58284b6455a36b4f4986b1 /util/cache.cc | |
parent | f933ad16934098460622bbc62d17761802486393 (diff) | |
parent | 8ccb79b57e877cb28b751d74e3e50bb4f8184997 (diff) | |
download | leveldb-3180f9cb402f51ce89be7011b103747bc6462976.tar.gz |
Merge branch 'master' into patch-1
Diffstat (limited to 'util/cache.cc')
-rw-r--r-- | util/cache.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/util/cache.cc b/util/cache.cc index 12de306..ad1e9a2 100644 --- a/util/cache.cc +++ b/util/cache.cc @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> - #include "leveldb/cache.h" + +#include <cassert> +#include <cstdio> +#include <cstdlib> + #include "port/port.h" #include "port/thread_annotations.h" #include "util/hash.h" @@ -278,7 +279,7 @@ Cache::Handle* LRUCache::Insert(const Slice& key, uint32_t hash, void* value, e->hash = hash; e->in_cache = false; e->refs = 1; // for the returned handle. - memcpy(e->key_data, key.data(), key.size()); + std::memcpy(e->key_data, key.data(), key.size()); if (capacity_ > 0) { e->refs++; // for the cache's reference. |