Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tcmalloc/internal/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#include <string.h>
#if defined(__linux__)
#include <sys/uio.h>
#if defined(__GLIBC__) && \
((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 15))
#define HAS_PROCESS_VM_READV 1
#endif
#endif // defined(__linux__)
#include <unistd.h>

Expand Down Expand Up @@ -130,7 +134,7 @@ bool SafeCopyMemory(const void* src, void* dst, size_t size) {
if (src == nullptr || dst == nullptr || size == 0) {
return false;
}
#if defined(__linux__)
#if defined(HAS_PROCESS_VM_READV)
struct iovec local_iov;
local_iov.iov_base = dst;
local_iov.iov_len = size;
Expand All @@ -144,7 +148,7 @@ bool SafeCopyMemory(const void* src, void* dst, size_t size) {
return bytes == static_cast<ssize_t>(size);
#else
return false;
#endif // defined(__linux__)
#endif // defined(HAS_PROCESS_VM_READV)
}

} // namespace tcmalloc_internal
Expand Down
Loading