From: Android Tools Maintainers Date: Tue, 19 Mar 2019 01:46:21 +0000 (+0000) Subject: Use a portable PAGE_SIZE X-Git-Tag: archive/raspbian/10.0.0+r36-3+rpi1~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=91bd8a0ebb19c7c78dedbd9ea8e9dbcedd49c690;p=android-platform-art.git Use a portable PAGE_SIZE PAGE_SIZE is not defined on some architectures such as arm64 and mips64el, so let's use a portable and standardized one. Gbp-Pq: Name PAGE_SIZE.patch --- diff --git a/runtime/base/safe_copy.cc b/runtime/base/safe_copy.cc index 06249ac..bb544c7 100644 --- a/runtime/base/safe_copy.cc +++ b/runtime/base/safe_copy.cc @@ -54,10 +54,10 @@ ssize_t SafeCopy(void *dst, const void *src, size_t len) { } src_iovs[iovecs_used].iov_base = const_cast(cur); - if (!IsAlignedParam(cur, PAGE_SIZE)) { - src_iovs[iovecs_used].iov_len = AlignUp(cur, PAGE_SIZE) - cur; + if (!IsAlignedParam(cur, getpagesize())) { + src_iovs[iovecs_used].iov_len = AlignUp(cur, getpagesize()) - cur; } else { - src_iovs[iovecs_used].iov_len = PAGE_SIZE; + src_iovs[iovecs_used].iov_len = getpagesize(); } src_iovs[iovecs_used].iov_len = std::min(src_iovs[iovecs_used].iov_len, len);