Commit e5095880 authored by ager@chromium.org's avatar ager@chromium.org

Add MAP_FIXED to Uncommit calls to see if that has an effect on GMail

memory usage in Chromium 64-bit Linux.

Review URL: http://codereview.chromium.org/200055

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2848 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3546e91b
...@@ -141,7 +141,9 @@ void* OS::Allocate(const size_t requested, ...@@ -141,7 +141,9 @@ void* OS::Allocate(const size_t requested,
void OS::Free(void* buf, const size_t length) { void OS::Free(void* buf, const size_t length) {
// TODO(1240712): munmap has a return value which is ignored here. // TODO(1240712): munmap has a return value which is ignored here.
munmap(buf, length); int result = munmap(buf, length);
USE(result);
ASSERT(result == 0);
} }
...@@ -334,7 +336,7 @@ bool VirtualMemory::Commit(void* address, size_t size, bool executable) { ...@@ -334,7 +336,7 @@ bool VirtualMemory::Commit(void* address, size_t size, bool executable) {
bool VirtualMemory::Uncommit(void* address, size_t size) { bool VirtualMemory::Uncommit(void* address, size_t size) {
return mmap(address, size, PROT_NONE, return mmap(address, size, PROT_NONE,
MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | MAP_FIXED,
kMmapFd, kMmapFdOffset) != MAP_FAILED; kMmapFd, kMmapFdOffset) != MAP_FAILED;
} }
......
...@@ -147,7 +147,9 @@ void* OS::Allocate(const size_t requested, ...@@ -147,7 +147,9 @@ void* OS::Allocate(const size_t requested,
void OS::Free(void* address, const size_t size) { void OS::Free(void* address, const size_t size) {
// TODO(1240712): munmap has a return value which is ignored here. // TODO(1240712): munmap has a return value which is ignored here.
munmap(address, size); int result = munmap(address, size);
USE(result);
ASSERT(result == 0);
} }
...@@ -362,7 +364,7 @@ bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { ...@@ -362,7 +364,7 @@ bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) {
bool VirtualMemory::Uncommit(void* address, size_t size) { bool VirtualMemory::Uncommit(void* address, size_t size) {
return mmap(address, size, PROT_NONE, return mmap(address, size, PROT_NONE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_FIXED,
kMmapFd, kMmapFdOffset) != MAP_FAILED; kMmapFd, kMmapFdOffset) != MAP_FAILED;
} }
......
...@@ -141,7 +141,9 @@ void* OS::Allocate(const size_t requested, ...@@ -141,7 +141,9 @@ void* OS::Allocate(const size_t requested,
void OS::Free(void* address, const size_t size) { void OS::Free(void* address, const size_t size) {
// TODO(1240712): munmap has a return value which is ignored here. // TODO(1240712): munmap has a return value which is ignored here.
munmap(address, size); int result = munmap(address, size);
USE(result);
ASSERT(result == 0);
} }
...@@ -318,7 +320,7 @@ bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { ...@@ -318,7 +320,7 @@ bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) {
bool VirtualMemory::Uncommit(void* address, size_t size) { bool VirtualMemory::Uncommit(void* address, size_t size) {
return mmap(address, size, PROT_NONE, return mmap(address, size, PROT_NONE,
MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | MAP_FIXED,
kMmapFd, kMmapFdOffset) != MAP_FAILED; kMmapFd, kMmapFdOffset) != MAP_FAILED;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment