Bug 98138 - Provide memory instrumentation for HashCountedSet
Summary: Provide memory instrumentation for HashCountedSet
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-02 03:33 PDT by Yury Semikhatsky
Modified: 2019-09-25 16:59 PDT (History)
17 users (show)

See Also:


Attachments
Patch (22.28 KB, patch)
2012-10-02 03:40 PDT, Yury Semikhatsky
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2012-10-02 03:33:54 PDT
We need to be able to estimate memory footprint of any HashCountedSet.
Comment 1 Yury Semikhatsky 2012-10-02 03:40:12 PDT
Created attachment 166655 [details]
Patch
Comment 2 Ilya Tikhonovsky 2012-10-02 09:27:40 PDT
Comment on attachment 166655 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=166655&action=review

> Source/WTF/wtf/MemoryInstrumentationSequence.h:58
> +    SequenceMemoryInstrumentationTraits<typename Conditional<IsConvertibleToInteger<ValueType>::value, int, ValueType>::Type>::reportMemoryUsage(begin, end, info);

I don't understand what is the benefit of this check (IsConvertibleToInteger)?
As I understand it doesn't matter that some type is convertible. We have to filter out POD types.
I'd say we have to use IsInteger here or even IsArithmatic which includes floats.
Comment 3 Yury Semikhatsky 2012-10-02 10:53:40 PDT
Comment on attachment 166655 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=166655&action=review

>> Source/WTF/wtf/MemoryInstrumentationSequence.h:58
>> +    SequenceMemoryInstrumentationTraits<typename Conditional<IsConvertibleToInteger<ValueType>::value, int, ValueType>::Type>::reportMemoryUsage(begin, end, info);
> 
> I don't understand what is the benefit of this check (IsConvertibleToInteger)?
> As I understand it doesn't matter that some type is convertible. We have to filter out POD types.
> I'd say we have to use IsInteger here or even IsArithmatic which includes floats.

As the comment says the check is added mainly because of  iterators over enum values. Like integers they cannot have methods and would cause compilation errors. Neither IsInterger nor IsArithmetic would would return true for enum so they are not an option.
Comment 4 Ilya Tikhonovsky 2012-10-02 11:44:30 PDT
lgtm
Comment 5 Yury Semikhatsky 2012-10-02 23:15:24 PDT
Committed r130253: <http://trac.webkit.org/changeset/130253>