Changeset 142384 in webkit
- Timestamp:
- Feb 9, 2013 7:48:27 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r142350 r142384 1 2013-02-09 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r137328. 4 http://trac.webkit.org/changeset/137328 5 https://bugs.webkit.org/show_bug.cgi?id=109367 6 7 causes memory usage to balloon if connection queue is filling 8 faster than sending (Requested by kling on #webkit). 9 10 * Platform/CoreIPC/ArgumentEncoder.cpp: 11 (CoreIPC::ArgumentEncoder::ArgumentEncoder): 12 (CoreIPC::ArgumentEncoder::grow): 13 * Platform/CoreIPC/ArgumentEncoder.h: 14 (CoreIPC::ArgumentEncoder::buffer): 15 (ArgumentEncoder): 16 1 17 2013-02-08 Sam Weinig <sam@webkit.org> 2 18 -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp
r141150 r142384 40 40 ArgumentEncoder::ArgumentEncoder() 41 41 : m_buffer(0) 42 , m_bufferPointer(0) 42 43 , m_bufferSize(0) 43 , m_bufferCapacity( inlineBufferSize)44 , m_bufferCapacity(0) 44 45 { 45 46 } … … 68 69 if (alignedSize + size > m_bufferCapacity) { 69 70 size_t newCapacity = std::max(alignedSize + size, std::max(static_cast<size_t>(32), m_bufferCapacity + m_bufferCapacity / 4 + 1)); 71 // Use system malloc / realloc instead of fastMalloc due to 72 // fastMalloc using MADV_FREE_REUSABLE which doesn't work with 73 // mach messages with OOL message and MACH_MSG_VIRTUAL_COPY. 74 // System malloc also calls madvise(MADV_FREE_REUSABLE) but after first 75 // checking via madvise(CAN_REUSE) that it will succeed. Should this 76 // behavior change we'll need to revisit this. 77 if (!m_buffer) 78 m_buffer = static_cast<uint8_t*>(malloc(newCapacity)); 79 else 80 m_buffer = static_cast<uint8_t*>(realloc(m_buffer, newCapacity)); 70 81 71 if (newCapacity > inlineBufferSize) { 72 // Use system malloc / realloc instead of fastMalloc due to 73 // fastMalloc using MADV_FREE_REUSABLE which doesn't work with 74 // mach messages with OOL message and MACH_MSG_VIRTUAL_COPY. 75 // System malloc also calls madvise(MADV_FREE_REUSABLE) but after first 76 // checking via madvise(CAN_REUSE) that it will succeed. Should this 77 // behavior change we'll need to revisit this. 78 if (!m_buffer) 79 m_buffer = static_cast<uint8_t*>(malloc(newCapacity)); 80 else 81 m_buffer = static_cast<uint8_t*>(realloc(m_buffer, newCapacity)); 82 83 if (!m_buffer) 84 CRASH(); 85 86 if (usesInlineBuffer()) 87 memcpy(m_buffer, m_inlineBuffer, m_bufferCapacity); 88 } 82 if (!m_buffer) 83 CRASH(); 89 84 90 85 m_bufferCapacity = newCapacity; … … 92 87 93 88 m_bufferSize = alignedSize + size; 94 return buffer() + alignedSize; 89 m_bufferPointer = m_buffer + alignedSize + size; 90 91 return m_buffer + alignedSize; 95 92 } 96 93 -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h
r141150 r142384 74 74 } 75 75 76 uint8_t* buffer() { return usesInlineBuffer() ? m_inlineBuffer :m_buffer; }76 uint8_t* buffer() const { return m_buffer; } 77 77 size_t bufferSize() const { return m_bufferSize; } 78 78 … … 84 84 85 85 private: 86 static const size_t inlineBufferSize = 4096;87 bool usesInlineBuffer() const { return m_bufferCapacity <= inlineBufferSize; }88 86 uint8_t* grow(unsigned alignment, size_t size); 89 87 90 88 uint8_t* m_buffer; 89 uint8_t* m_bufferPointer; 91 90 92 91 size_t m_bufferSize; … … 94 93 95 94 Vector<Attachment> m_attachments; 96 97 uint8_t m_inlineBuffer[inlineBufferSize];98 95 }; 99 96
Note: See TracChangeset
for help on using the changeset viewer.