Skip to content
Permalink
Browse files
bmalloc: vm allocations should plant guard pages
https://bugs.webkit.org/show_bug.cgi?id=156937

Rolling out - looks like this is memory regression.

* bmalloc/Object.h:
(bmalloc::Object::operator+):
(bmalloc::Object::operator<=):
(bmalloc::Object::operator-): Deleted.
* bmalloc/VMAllocate.h:
(bmalloc::vmDeallocate):
(bmalloc::vmRevokePermissions): Deleted.
* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::allocateSmallChunk):



Canonical link: https://commits.webkit.org/175058@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199950 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Gavin Barraclough committed Apr 23, 2016
1 parent 19208b8 commit 3d2e33724a9596a7486431b7d7595c28d536348c
Showing with 17 additions and 18 deletions.
  1. +17 −0 Source/bmalloc/ChangeLog
  2. +0 −6 Source/bmalloc/bmalloc/Object.h
  3. +0 −6 Source/bmalloc/bmalloc/VMAllocate.h
  4. +0 −6 Source/bmalloc/bmalloc/VMHeap.cpp
@@ -1,3 +1,20 @@
2016-04-23 Gavin Barraclough <barraclough@apple.com>

bmalloc: vm allocations should plant guard pages
https://bugs.webkit.org/show_bug.cgi?id=156937

Rolling out - looks like this is memory regression.

* bmalloc/Object.h:
(bmalloc::Object::operator+):
(bmalloc::Object::operator<=):
(bmalloc::Object::operator-): Deleted.
* bmalloc/VMAllocate.h:
(bmalloc::vmDeallocate):
(bmalloc::vmRevokePermissions): Deleted.
* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::allocateSmallChunk):

2016-04-22 Geoffrey Garen <ggaren@apple.com>

bmalloc: vm allocations should plant guard pages
@@ -52,7 +52,6 @@ class Object {
SmallPage* page();

Object operator+(size_t);
Object operator-(size_t);
bool operator<=(const Object&);

private:
@@ -65,11 +64,6 @@ inline Object Object::operator+(size_t offset)
return Object(m_chunk, m_offset + offset);
}

inline Object Object::operator-(size_t offset)
{
return Object(m_chunk, m_offset - offset);
}

inline bool Object::operator<=(const Object& other)
{
BASSERT(m_chunk == other.m_chunk);
@@ -137,12 +137,6 @@ inline void vmDeallocate(void* p, size_t vmSize)
munmap(p, vmSize);
}

inline void vmRevokePermissions(void* p, size_t vmSize)
{
vmValidate(p, vmSize);
mprotect(p, vmSize, PROT_NONE);
}

// Allocates vmSize bytes at a specified power-of-two alignment.
// Use this function to create maskable memory regions.

@@ -75,12 +75,6 @@ void VMHeap::allocateSmallChunk(std::lock_guard<StaticMutex>& lock, size_t pageC
Object begin(chunk, metadataSize);
Object end(chunk, chunkSize);

vmRevokePermissions(begin.begin(), pageSize);
vmRevokePermissions(end.begin() - pageSize, pageSize);

begin = begin + pageSize;
end = end - pageSize;

for (Object it = begin; it + pageSize <= end; it = it + pageSize) {
SmallPage* page = it.page();
new (page) SmallPage;

0 comments on commit 3d2e337

Please sign in to comment.