WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
89661
Web Inspector: Properly display native memory sizes bigger than 2GB
https://bugs.webkit.org/show_bug.cgi?id=89661
Summary
Web Inspector: Properly display native memory sizes bigger than 2GB
Alexei Filippov
Reported
2012-06-21 07:20:19 PDT
Created
attachment 148795
[details]
screenshot Currently when a component size exceeds 2GB it is shown as a negative value.
Attachments
screenshot
(74.39 KB, image/png)
2012-06-21 07:20 PDT
,
Alexei Filippov
no flags
Details
Patch
(4.84 KB, patch)
2012-06-21 07:25 PDT
,
Alexei Filippov
no flags
Details
Formatted Diff
Diff
Patch
(4.71 KB, patch)
2012-06-21 08:12 PDT
,
Alexei Filippov
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Alexei Filippov
Comment 1
2012-06-21 07:25:43 PDT
Created
attachment 148796
[details]
Patch
Yury Semikhatsky
Comment 2
2012-06-21 07:32:54 PDT
Comment on
attachment 148796
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=148796&action=review
> Source/WebCore/inspector/InspectorMemoryAgent.cpp:340 > + jsHeapAllocated->setSize(static_cast<double>(totalJSHeapSize));
int to double conversion shouldn't require static_cast, pleas remove it.
Alexei Filippov
Comment 3
2012-06-21 07:41:54 PDT
Comment on
attachment 148796
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=148796&action=review
>> Source/WebCore/inspector/InspectorMemoryAgent.cpp:340 >> + jsHeapAllocated->setSize(static_cast<double>(totalJSHeapSize)); > > int to double conversion shouldn't require static_cast, pleas remove it.
It is size_t which is 64-bits long on x64, thus it may lead to precision loss when converted to double, thus it should require a cast.
Alexander Pavlov (apavlov)
Comment 4
2012-06-21 07:58:35 PDT
Comment on
attachment 148796
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=148796&action=review
>>> Source/WebCore/inspector/InspectorMemoryAgent.cpp:340 >>> + jsHeapAllocated->setSize(static_cast<double>(totalJSHeapSize)); >> >> int to double conversion shouldn't require static_cast, pleas remove it. > > It is size_t which is 64-bits long on x64, thus it may lead to precision loss when converted to double, thus it should require a cast.
So, what will static_cast do in this case?
Yury Semikhatsky
Comment 5
2012-06-21 08:01:37 PDT
(In reply to
comment #3
)
> (From update of
attachment 148796
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=148796&action=review
> > int to double conversion shouldn't require static_cast, pleas remove it. > > It is size_t which is 64-bits long on x64, thus it may lead to precision loss when converted to double, thus it should require a cast.
But C++ compiler won't complain in that case.
Alexei Filippov
Comment 6
2012-06-21 08:03:23 PDT
(In reply to
comment #4
)
> (From update of
attachment 148796
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=148796&action=review
> > >>> Source/WebCore/inspector/InspectorMemoryAgent.cpp:340 > >>> + jsHeapAllocated->setSize(static_cast<double>(totalJSHeapSize)); > >> > >> int to double conversion shouldn't require static_cast, pleas remove it. > > > > It is size_t which is 64-bits long on x64, thus it may lead to precision loss when converted to double, thus it should require a cast. > > So, what will static_cast do in this case?
Convert uint64 to double losing precision. If I remove the cast it will also do the conversion on some platforms while reporting warnings and errors on other platforms & flag settings.
Alexei Filippov
Comment 7
2012-06-21 08:04:02 PDT
(In reply to
comment #5
)
> (In reply to
comment #3
) > > (From update of
attachment 148796
[details]
[details]) > > View in context:
https://bugs.webkit.org/attachment.cgi?id=148796&action=review
> > > int to double conversion shouldn't require static_cast, pleas remove it. > > > > It is size_t which is 64-bits long on x64, thus it may lead to precision loss when converted to double, thus it should require a cast. > > But C++ compiler won't complain in that case.
Ok, if you insist I'll remove the cast.
Alexei Filippov
Comment 8
2012-06-21 08:12:14 PDT
Created
attachment 148806
[details]
Patch
WebKit Review Bot
Comment 9
2012-06-21 21:07:57 PDT
Comment on
attachment 148806
[details]
Patch Clearing flags on attachment: 148806 Committed
r121002
: <
http://trac.webkit.org/changeset/121002
>
WebKit Review Bot
Comment 10
2012-06-21 21:08:02 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug