[Webkit-unassigned] [Bug 43716] Use a HashMap for m_continuation to save memory
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Dec 13 10:11:48 PST 2010
https://bugs.webkit.org/show_bug.cgi?id=43716
Darin Adler <darin at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #66184|review? |review+
Flag| |
--- Comment #14 from Darin Adler <darin at apple.com> 2010-12-13 10:11:47 PST ---
(From update of attachment 66184)
View in context: https://bugs.webkit.org/attachment.cgi?id=66184&action=review
> WebCore/rendering/RenderBlock.h:135
> + RenderBoxModelObject* continuation() const { return RenderBoxModelObject::continuation(); }
> + void setContinuation(RenderBoxModelObject* continuation) { RenderBoxModelObject::setContinuation(continuation); }
As I said before, this should be “using” rather than a forwarding inline function.
> WebCore/rendering/RenderBoxModelObject.cpp:63
> +static ContinuationMap* gContinuationMap = 0;
The use of the “g” prefix here is not common in WebKit code. I did a search and found that most global variables of this type do not use this sort of prefix.
> WebCore/rendering/RenderBoxModelObject.cpp:1796
> + if (!gContinuationMap)
> + gContinuationMap = new ContinuationMap;
> +
> + if (continuation)
> + gContinuationMap->set(this, continuation);
> + else
> + gContinuationMap->remove(this);
The creation of the map could be moved inside the non-zero case, since is no need to create the map to remove something from it. Probably OK the way it is, though, since we’d still need a null check of gContinuationMap.
> WebCore/rendering/RenderInline.h:63
> + RenderBoxModelObject* continuation() const { return RenderBoxModelObject::continuation(); }
> + void setContinuation(RenderBoxModelObject* continuation) { RenderBoxModelObject::setContinuation(continuation); }
Again, I think “using” is the way to go.
--
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