Changeset 199936 in webkit
- Timestamp:
- Apr 22, 2016 4:56:53 PM (8 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/ChangeLog
r199934 r199936 1 2016-04-22 Geoffrey Garen <ggaren@apple.com> 2 3 bmalloc: vm allocations should plant guard pages 4 https://bugs.webkit.org/show_bug.cgi?id=156937 5 6 Reviewed by Michael Saboff. 7 8 * bmalloc/Object.h: 9 (bmalloc::Object::operator-): Added a - helper. 10 11 * bmalloc/VMAllocate.h: 12 (bmalloc::vmRevokePermissions): Added a helper to revoke permissions on 13 a VM region. We use this for guard pages. 14 15 * bmalloc/VMHeap.cpp: 16 (bmalloc::VMHeap::allocateSmallChunk): Add guard pages to the start and 17 end of the chunk. 18 19 Note that we don't guard large chunks becuase we need to be able to merge 20 them. Otherwise, we will run out of virtual addresses. 21 1 22 2016-04-22 Geoffrey Garen <ggaren@apple.com> 2 23 -
trunk/Source/bmalloc/bmalloc/Object.h
r199746 r199936 53 53 54 54 Object operator+(size_t); 55 Object operator-(size_t); 55 56 bool operator<=(const Object&); 56 57 … … 65 66 } 66 67 68 inline Object Object::operator-(size_t offset) 69 { 70 return Object(m_chunk, m_offset - offset); 71 } 72 67 73 inline bool Object::operator<=(const Object& other) 68 74 { -
trunk/Source/bmalloc/bmalloc/VMAllocate.h
r199759 r199936 138 138 } 139 139 140 inline void vmRevokePermissions(void* p, size_t vmSize) 141 { 142 vmValidate(p, vmSize); 143 mprotect(p, vmSize, PROT_NONE); 144 } 145 140 146 // Allocates vmSize bytes at a specified power-of-two alignment. 141 147 // Use this function to create maskable memory regions. -
trunk/Source/bmalloc/bmalloc/VMHeap.cpp
r199759 r199936 76 76 Object end(chunk, chunkSize); 77 77 78 vmRevokePermissions(begin.begin(), pageSize); 79 vmRevokePermissions(end.begin() - pageSize, pageSize); 80 81 begin = begin + pageSize; 82 end = end - pageSize; 83 78 84 for (Object it = begin; it + pageSize <= end; it = it + pageSize) { 79 85 SmallPage* page = it.page();
Note: See TracChangeset
for help on using the changeset viewer.