[Webkit-unassigned] [Bug 94712] High memory usage spike in AssemblerBuffer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 23 14:22:06 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=94712





--- Comment #6 from Benjamin Poulain <benjamin at webkit.org>  2012-08-23 14:22:04 PST ---
(From update of attachment 160242)
View in context: https://bugs.webkit.org/attachment.cgi?id=160235&action=review

Please add WTF tests for the SegmentedVector additions.

> Source/WTF/wtf/SegmentedVector.h:-44
> -        ~SegmentedVectorIterator() { }

I think that was here so that some compiler do not generate a real function for the empty destructor.

> Source/WTF/wtf/SegmentedVector.h:72
> +            m_index += offset;
> +            m_segment += m_index / SegmentSize;
> +            m_index %= SegmentSize;

Use a temporary variable instead of abusing m_index.

> Source/WTF/wtf/SegmentedVector.h:79
> +            // Points to the "end" symbol
> +            m_segment = 0;
> +            m_index = SegmentSize;

Missing period on the comment.
Instead of duplicating the code, please consider making it an utility function.

> Source/WTF/wtf/SegmentedVector.h:112
> +        size_t indexInSegment() const { return m_index; }
> +
> +        void proceedToNextSegment()
> +        {
> +            if (++m_segment >= m_vector.m_segments.size()) {
> +                // Points to the "end" symbol
> +                m_segment = 0;
> +                m_index = SegmentSize;
> +            } else
> +                m_index = 0;
> +        }

This is weird. Isn't this the wrong abstraction?
Why not give the "copy" capability to SegmentedVector?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list