Bug 26194

Summary: DeprecatedPtrList should be removed
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
list of places that DeprecatedPtrList is used none

Eric Seidel (no email)
Reported 2009-06-04 12:32:47 PDT
DeprecatedPtrList should be removed The last client is on RenderBlock: DeprecatedPtrList<FloatingObject>* m_floatingObjects; And the only times its used, it would work as well or better as a Vector. See the attached list of uses in the code. Note that we never insert or remove from the middle of the list. A vector will be more space efficient! I'll post a patch to do this tomorrow if no one beats me to it.
Attachments
list of places that DeprecatedPtrList is used (6.52 KB, text/plain)
2009-06-04 12:33 PDT, Eric Seidel (no email)
no flags
Eric Seidel (no email)
Comment 1 2009-06-04 12:33:23 PDT
Created attachment 30953 [details] list of places that DeprecatedPtrList is used
Eric Seidel (no email)
Comment 2 2009-06-04 12:37:09 PDT
Ok, I lied. There is one removeRef call in: void RenderBlock::removeFloatingObject(RenderBox* o) which does remove from the middle of the list. That's called from: void RenderBlock::markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove, bool inLayout) which I would expect is expected to be O(N), not O(N^2) as it could be if we moved to a Vector here. Hum...
Eric Seidel (no email)
Comment 3 2009-06-04 12:41:19 PDT
The only time floatToRemove is ever non-null is from: void RenderBox::removeFloatingOrPositionedChildFromBlockLists() Which is only called when an object is losing float status in a styleWillChange or the like. I was also wrong above. This will not turn this from O(N) to O(N^2) because we're only going to remove it once. This will cause pages which make things floating-and-then-not-again slower, but I doubt anyone would notice. I do expect the iPhone will notice the memory savings on all pages which include floats! :) So I still think this change is a good one.
Sam Weinig
Comment 4 2009-08-06 12:17:13 PDT
*** This bug has been marked as a duplicate of bug 17425 ***
Note You need to log in before you can comment on or make changes to this bug.