electron/patches/mips64el/v8/Fix-v8-loongson-page-size.patch
Jeremy Apthorp 76c5f5cc8a
build: move libcc patches to electron repo (#14104)
In the GN build, libchromiumcontent is no longer a distinct library, but
merely a container for a set of scripts and patches. Maintaining those
patches in a separate repository is tedious and error-prone, so merge
them into the main repo.

Once this is merged and GN is the default way to build Electron, the
libchromiumcontent repository can be archived.
2018-09-13 22:02:16 -07:00

38 lines
1.1 KiB
Diff

diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc
index 31da953..14c6c55 100644
--- a/src/base/platform/platform-posix.cc
+++ b/src/base/platform/platform-posix.cc
@@ -97,7 +97,11 @@ int OS::ActivationFrameAlignment() {
intptr_t OS::CommitPageSize() {
+#if V8_TARGET_ARCH_MIPS64
+ static intptr_t page_size = 16384;
+#else
static intptr_t page_size = getpagesize();
+#endif
return page_size;
}
@@ -241,7 +245,7 @@ void* OS::GetRandomMmapAddr() {
size_t OS::AllocateAlignment() {
- return static_cast<size_t>(sysconf(_SC_PAGESIZE));
+ return 16384;
}
diff --git a/src/base/sys-info.cc b/src/base/sys-info.cc
index 1b6d393..2a93061 100644
--- a/src/base/sys-info.cc
+++ b/src/base/sys-info.cc
@@ -90,7 +90,7 @@ int64_t SysInfo::AmountOfPhysicalMemory() {
return static_cast<int64_t>(result) * 1024L;
#elif V8_OS_POSIX
long pages = sysconf(_SC_PHYS_PAGES); // NOLINT(runtime/int)
- long page_size = sysconf(_SC_PAGESIZE); // NOLINT(runtime/int)
+ long page_size = 16384; // NOLINT(runtime/int)
if (pages == -1 || page_size == -1) {
return 0;
}