// Copyright 2020 Google LLC. All Rights Reserved. #ifndef WHITEBOX_IMPL_REFERENCE_MEMORY_UTIL_H_ #define WHITEBOX_IMPL_REFERENCE_MEMORY_UTIL_H_ #include #include namespace widevine { // Copied from the documentation for memcpy() with minor modifications: // // Copies |src_size| bytes from |src| to |dest| if |dest_size| is greater or // equal to |src_size|. // // The underlying type of the objects pointed to by |src| and |dest| are // irrelevant for this function; the result is a binary copy of the data. // // To avoid overflows, |src_size| is compared against |dest_size|. If there // won't be enough room, the copy is not attempted and false is returned. // // |src| and |dest| should not overlap. For overlapping memory blocks, // memmove is a safer approach). bool MemCopy(const void* src, size_t src_size, void* dest, size_t dest_size); } // namespace widevine #endif // WHITEBOX_IMPL_REFERENCE_MEMORY_UTIL_H_