[Webkit-unassigned] [Bug 136340] GC length unit is invalid
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Aug 28 06:54:58 PDT 2014
https://bugs.webkit.org/show_bug.cgi?id=136340
Mark Hahnenberg <mhahnenb at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #237309|review? |review-
Flag| |
--- Comment #2 from Mark Hahnenberg <mhahnenb at gmail.com> 2014-08-28 06:55:05 PST ---
(From update of attachment 237309)
View in context: https://bugs.webkit.org/attachment.cgi?id=237309&action=review
This looks like a good change, but I think we can make it even better and be good citizens in the process :-)
> Source/JavaScriptCore/heap/HeapStatistics.cpp:256
> + if ((storageStatistics.storageCapacity() > 0) && (storageStatistics.objectCount() > 0)) {
> + dataLogF("wasted .property storage: %ldkB (%ld%%)\n",
> + static_cast<long>(
> + (storageStatistics.storageCapacity() - storageStatistics.storageSize()) / KB),
> + static_cast<long>(
> + (storageStatistics.storageCapacity() - storageStatistics.storageSize()) * 100
> + / storageStatistics.storageCapacity()));
> + dataLogF("objects with out-of-line .property storage: %ld (%ld%%)\n",
> + static_cast<long>(
> + storageStatistics.objectWithOutOfLineStorageCount()),
> + static_cast<long>(
> + storageStatistics.objectWithOutOfLineStorageCount() * 100
> + / storageStatistics.objectCount()));
> + }
This is very weirdly formatted code. Maybe we could clean it up a little since we're already here.
I'd suggest computing the wasted property storage and storing it in a local variable, then printing it out in a normal looking dataLogF below. You can use control flow to avoid the div-by-zero issue when computing that value. Ditto for objects w/ out-of-line property storage.
--
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