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
This commit is contained in:
parent
3546e91bbc
commit
e5095880cb
@ -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) {
|
|||||||
|
|
||||||
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,
|
|||||||
|
|
||||||
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) {
|
|||||||
|
|
||||||
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,
|
|||||||
|
|
||||||
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) {
|
|||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user