Changeset 47159 in webkit
- Timestamp:
- Aug 12, 2009 4:07:08 PM (15 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r47102 r47159 1 2009-08-12 Ada Chan <adachan@apple.com> 2 3 Added workaround for the limitation that VirtualFree with MEM_RELEASE 4 can only accept the base address returned by VirtualAlloc when the region 5 was reserved and it can only free the entire region, and not a part of it. 6 7 Reviewed by Oliver Hunt. 8 9 * runtime/MarkStack.h: 10 (JSC::MarkStack::MarkStackArray::shrinkAllocation): 11 * runtime/MarkStackWin.cpp: 12 (JSC::MarkStack::releaseStack): 13 1 14 2009-08-12 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> 2 15 -
trunk/JavaScriptCore/runtime/MarkStack.h
r47023 r47159 151 151 if (size == m_allocated) 152 152 return; 153 #if PLATFORM(WIN) 154 // We cannot release a part of a region with VirtualFree. To get around this, 155 // we'll release the entire region and reallocate the size that we want. 156 releaseStack(m_data, m_allocated); 157 m_data = reinterpret_cast<T*>(allocateStack(size)); 158 #else 153 159 releaseStack(reinterpret_cast<char*>(m_data) + size, m_allocated - size); 160 #endif 154 161 m_allocated = size; 155 162 m_capacity = m_allocated / sizeof(T); -
trunk/JavaScriptCore/runtime/MarkStackWin.cpp
r47023 r47159 44 44 return VirtualAlloc(0, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); 45 45 } 46 void MarkStack::releaseStack(void* addr, size_t size)46 void MarkStack::releaseStack(void* addr, size_t) 47 47 { 48 VirtualFree(addr, size, MEM_RELEASE); 48 // According to http://msdn.microsoft.com/en-us/library/aa366892(VS.85).aspx, 49 // dwSize must be 0 if dwFreeType is MEM_RELEASE. 50 VirtualFree(addr, 0, MEM_RELEASE); 49 51 } 50 52
Note: See TracChangeset
for help on using the changeset viewer.