Changeset 160063 in webkit
- Timestamp:
- Dec 3, 2013 6:19:09 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r160062 r160063 1 2013-12-03 Mark Lam <mark.lam@apple.com> 2 3 testapi test crashes on Windows in WTF::Vector<wchar_t,64,WTF::UnsafeVectorOverflow>::size(). 4 https://bugs.webkit.org/show_bug.cgi?id=121972. 5 6 Reviewed by Brent Fulgham. 7 8 * interpreter/JSStack.cpp: 9 (JSC::JSStack::~JSStack): 10 - Reverting the change from r160004 since it's better to fix OSAllocatorWin 11 to be consistent with OSAllocatorPosix. 12 1 13 2013-12-03 Mark Lam <mark.lam@apple.com> 2 14 -
trunk/Source/JavaScriptCore/interpreter/JSStack.cpp
r160004 r160063 64 64 { 65 65 void* highAddress = reinterpret_cast<void*>(static_cast<char*>(m_reservation.base()) + m_reservation.size()); 66 if (highAddress > m_commitEnd) { 67 m_reservation.decommit(reinterpret_cast<void*>(m_commitEnd), reinterpret_cast<intptr_t>(highAddress) - reinterpret_cast<intptr_t>(m_commitEnd)); 68 addToCommittedByteCount(-(reinterpret_cast<intptr_t>(highAddress) - reinterpret_cast<intptr_t>(m_commitEnd))); 69 } 66 m_reservation.decommit(reinterpret_cast<void*>(m_commitEnd), reinterpret_cast<intptr_t>(highAddress) - reinterpret_cast<intptr_t>(m_commitEnd)); 67 addToCommittedByteCount(-(reinterpret_cast<intptr_t>(highAddress) - reinterpret_cast<intptr_t>(m_commitEnd))); 70 68 m_reservation.deallocate(); 71 69 } -
trunk/Source/WTF/ChangeLog
r159987 r160063 1 2013-12-03 Mark Lam <mark.lam@apple.com> 2 3 testapi test crashes on Windows in WTF::Vector<wchar_t,64,WTF::UnsafeVectorOverflow>::size(). 4 https://bugs.webkit.org/show_bug.cgi?id=121972. 5 6 Reviewed by Brent Fulgham. 7 8 * wtf/OSAllocatorWin.cpp: 9 (WTF::OSAllocator::decommit): 10 (WTF::OSAllocator::releaseDecommitted): 11 - Added a check to ensure that the bytes to decommit / release is not 0. 12 On Windows, a 0 length passed to VirtualFree() has a special meaning, 13 and it's not "decommit / release nothing" as one would expect. Adding 14 this check makes OSAllocatorWin consistent with OSAllocatorPosix for 15 these 2 functions. 16 1 17 2013-12-02 Mark Lam <mark.lam@apple.com> 2 18 -
trunk/Source/WTF/wtf/OSAllocatorWin.cpp
r139974 r160063 66 66 void OSAllocator::decommit(void* address, size_t bytes) 67 67 { 68 // According to http://msdn.microsoft.com/en-us/library/aa366892(VS.85).aspx, 69 // bytes (i.e. dwSize) being 0 when dwFreeType is MEM_DECOMMIT means that we'll 70 // decommit the entire region allocated by VirtualAlloc() instead of decommitting 71 // nothing as we would expect. Hence, we should check if bytes is 0 and handle it 72 // appropriately before calling VirtualFree(). 73 // See: https://bugs.webkit.org/show_bug.cgi?id=121972. 74 if (!bytes) 75 return; 68 76 bool result = VirtualFree(address, bytes, MEM_DECOMMIT); 69 77 if (!result) … … 73 81 void OSAllocator::releaseDecommitted(void* address, size_t bytes) 74 82 { 83 // See comment in OSAllocator::decommit(). Similarly, when bytes is 0, we 84 // don't want to release anything. So, don't call VirtualFree() below. 85 if (!bytes) 86 return; 75 87 // According to http://msdn.microsoft.com/en-us/library/aa366892(VS.85).aspx, 76 88 // dwSize must be 0 if dwFreeType is MEM_RELEASE.
Note: See TracChangeset
for help on using the changeset viewer.