Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1572)

Unified Diff: Source/wtf/OSAllocatorPosix.cpp

Issue 14482004: Remove OS(QNX) support. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/NumberOfCores.cpp ('k') | Source/wtf/Platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/OSAllocatorPosix.cpp
diff --git a/Source/wtf/OSAllocatorPosix.cpp b/Source/wtf/OSAllocatorPosix.cpp
index 44698cf9ffda0ec7828d480ab4d31a93885bccc8..49597e5bc05a09db054c083462cad9f870be2a11 100644
--- a/Source/wtf/OSAllocatorPosix.cpp
+++ b/Source/wtf/OSAllocatorPosix.cpp
@@ -38,12 +38,7 @@ namespace WTF {
void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, bool executable, bool includesGuardPages)
{
-#if OS(QNX)
- // Reserve memory with PROT_NONE and MAP_LAZY so it isn't committed now.
- void* result = mmap(0, bytes, PROT_NONE, MAP_LAZY | MAP_PRIVATE | MAP_ANON, -1, 0);
- if (result == MAP_FAILED)
- CRASH();
-#elif OS(LINUX)
+#if OS(LINUX)
UNUSED_PARAM(usage);
UNUSED_PARAM(writable);
UNUSED_PARAM(executable);
@@ -60,7 +55,7 @@ void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable,
while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
#endif
-#endif // OS(QNX)
+#endif // OS(LINUX)
return result;
}
@@ -126,15 +121,7 @@ void* OSAllocator::reserveAndCommit(size_t bytes, Usage usage, bool writable, bo
void OSAllocator::commit(void* address, size_t bytes, bool writable, bool executable)
{
-#if OS(QNX)
- int protection = PROT_READ;
- if (writable)
- protection |= PROT_WRITE;
- if (executable)
- protection |= PROT_EXEC;
- if (MAP_FAILED == mmap(address, bytes, protection, MAP_FIXED | MAP_PRIVATE | MAP_ANON, -1, 0))
- CRASH();
-#elif OS(LINUX)
+#if OS(LINUX)
int protection = PROT_READ;
if (writable)
protection |= PROT_WRITE;
@@ -158,10 +145,7 @@ void OSAllocator::commit(void* address, size_t bytes, bool writable, bool execut
void OSAllocator::decommit(void* address, size_t bytes)
{
-#if OS(QNX)
- // Use PROT_NONE and MAP_LAZY to decommit the pages.
- mmap(address, bytes, PROT_NONE, MAP_FIXED | MAP_LAZY | MAP_PRIVATE | MAP_ANON, -1, 0);
-#elif OS(LINUX)
+#if OS(LINUX)
madvise(address, bytes, MADV_DONTNEED);
if (mprotect(address, bytes, PROT_NONE))
CRASH();
« no previous file with comments | « Source/wtf/NumberOfCores.cpp ('k') | Source/wtf/Platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698