Bug 26194 - DeprecatedPtrList should be removed
Summary: DeprecatedPtrList should be removed
Status: RESOLVED DUPLICATE of bug 17425
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-04 12:32 PDT by Eric Seidel (no email)
Modified: 2009-08-06 12:17 PDT (History)
1 user (show)

See Also:


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 Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 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.
Comment 1 Eric Seidel (no email) 2009-06-04 12:33:23 PDT
Created attachment 30953 [details]
list of places that DeprecatedPtrList is used
Comment 2 Eric Seidel (no email) 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...
Comment 3 Eric Seidel (no email) 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.
Comment 4 Sam Weinig 2009-08-06 12:17:13 PDT

*** This bug has been marked as a duplicate of bug 17425 ***