diff --git a/src/ripple/basics/SlabAllocator.h b/src/ripple/basics/SlabAllocator.h index bd950123c6d..ece96d0b873 100644 --- a/src/ripple/basics/SlabAllocator.h +++ b/src/ripple/basics/SlabAllocator.h @@ -80,7 +80,7 @@ class SlabAllocator { // Use memcpy to avoid unaligned UB // (will optimize to equivalent code) - memcpy(data, &l_, sizeof(std::uint8_t*)); + std::memcpy(data, &l_, sizeof(std::uint8_t*)); l_ = data; data += item; } @@ -122,7 +122,7 @@ class SlabAllocator { // Use memcpy to avoid unaligned UB // (will optimize to equivalent code) - memcpy(&l_, ret, sizeof(std::uint8_t*)); + std::memcpy(&l_, ret, sizeof(std::uint8_t*)); } } @@ -147,7 +147,7 @@ class SlabAllocator // Use memcpy to avoid unaligned UB // (will optimize to equivalent code) - memcpy(ptr, &l_, sizeof(std::uint8_t*)); + std::memcpy(ptr, &l_, sizeof(std::uint8_t*)); l_ = ptr; } }; diff --git a/src/ripple/basics/impl/partitioned_unordered_map.cpp b/src/ripple/basics/impl/partitioned_unordered_map.cpp index d7d2488f300..3ced32eddff 100644 --- a/src/ripple/basics/impl/partitioned_unordered_map.cpp +++ b/src/ripple/basics/impl/partitioned_unordered_map.cpp @@ -34,7 +34,7 @@ extract(uint256 const& key) std::size_t result; // Use memcpy to avoid unaligned UB // (will optimize to equivalent code) - memcpy(&result, key.data(), sizeof(std::size_t)); + std::memcpy(&result, key.data(), sizeof(std::size_t)); return result; } diff --git a/src/ripple/beast/hash/impl/xxhash.cpp b/src/ripple/beast/hash/impl/xxhash.cpp index 232c5a929da..4a6c85db815 100644 --- a/src/ripple/beast/hash/impl/xxhash.cpp +++ b/src/ripple/beast/hash/impl/xxhash.cpp @@ -33,6 +33,8 @@ You can contact the author at : #include +#include + //************************************** // Tuning parameters //************************************** @@ -87,7 +89,7 @@ You can contact the author at : //************************************** // Includes & Memory related functions //************************************** -//#include "xxhash.h" +// #include "xxhash.h" // Modify the local functions below should you wish to use some other memory // routines for malloc(), free() #include @@ -263,7 +265,7 @@ XXH_readLE64_align(const void* ptr, XXH_endianess endian, XXH_alignment align) { // Use memcpy to avoid unaligned UB U64 tmp_aligned; - memcpy(&tmp_aligned, ptr, sizeof(U64)); + std::memcpy(&tmp_aligned, ptr, sizeof(U64)); return endian == XXH_littleEndian ? tmp_aligned : XXH_swap64(tmp_aligned); }