Chromium Code Reviews| Index: base/memory/discardable_shared_memory.cc |
| diff --git a/base/memory/discardable_shared_memory.cc b/base/memory/discardable_shared_memory.cc |
| index acae29eabadec0a16de0ed5e0e43f672d3faddca..c04e5c41c58d0b7945afcafb25e7d5cd3b5aee05 100644 |
| --- a/base/memory/discardable_shared_memory.cc |
| +++ b/base/memory/discardable_shared_memory.cc |
| @@ -24,10 +24,6 @@ |
| #include "third_party/ashmem/ashmem.h" |
| #endif |
| -#if defined(OS_WIN) |
| -#include "base/win/windows_version.h" |
| -#endif |
| - |
| namespace base { |
| namespace { |
| @@ -234,14 +230,6 @@ DiscardableSharedMemory::LockResult DiscardableSharedMemory::Lock( |
| return PURGED; |
| } |
| } |
| -#elif defined(OS_WIN) |
| - if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
| - if (!VirtualAlloc(reinterpret_cast<char*>(shared_memory_.memory()) + |
| - AlignToPageSize(sizeof(SharedState)) + offset, |
| - length, MEM_RESET_UNDO, PAGE_READWRITE)) { |
|
danakj
2016/03/25 23:49:39
I'm confused by this code heh.
https://msdn.micro
reveman
2016/03/26 07:01:10
Discardable memory is initially locked. The only t
|
| - return PURGED; |
| - } |
| - } |
| #endif |
| return SUCCESS; |
| @@ -269,18 +257,6 @@ void DiscardableSharedMemory::Unlock(size_t offset, size_t length) { |
| DPLOG(ERROR) << "ashmem_unpin_region() failed"; |
| } |
| } |
| -#elif defined(OS_WIN) |
| - if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
| - // Note: MEM_RESET is not technically gated on Win8. However, this Unlock |
| - // function needs to match the Lock behaviour (MEM_RESET_UNDO) to properly |
| - // implement memory pinning. It needs to bias towards preserving the |
| - // contents of memory between an Unlock and next Lock. |
| - if (!VirtualAlloc(reinterpret_cast<char*>(shared_memory_.memory()) + |
| - AlignToPageSize(sizeof(SharedState)) + offset, |
| - length, MEM_RESET, PAGE_READWRITE)) { |
| - DPLOG(ERROR) << "VirtualAlloc() MEM_RESET failed in Unlock()"; |
| - } |
| - } |
| #endif |
| size_t start = offset / base::GetPageSize(); |