Bug 151920 - [Cocoa] ResourceUsageOverlay should query kernel for VM page size.
Summary: [Cocoa] ResourceUsageOverlay should query kernel for VM page size.
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
Depends on:
Reported: 2015-12-05 22:10 PST by Andreas Kling
Modified: 2015-12-08 09:51 PST (History)
1 user (show)

See Also:

Patch (3.15 KB, patch)
2015-12-05 22:11 PST, Andreas Kling
aestes: review+
Details | Formatted Diff | Diff
Patch for landing (3.23 KB, patch)
2015-12-08 08:56 PST, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2015-12-05 22:10:31 PST
On systems where hw.pagesize != vm.pagesize, we get goofy looking memory numbers.
Comment 1 Andreas Kling 2015-12-05 22:11:01 PST
Created attachment 266726 [details]
Comment 2 Andy Estes 2015-12-07 21:11:04 PST
Comment on attachment 266726 [details]

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

> Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm:79
> +        sysctlbyname("vm.pagesize", &pageSize, &outputSize, nullptr, 0);

Could you ASSERT that outputSize still equals sizeof(pageSize) after this call? You might also want to either handle an error or ASSERT that none occurred. I'm imagining a case where we could end up diving by zero later on.
Comment 3 Andreas Kling 2015-12-08 08:56:54 PST
Created attachment 266892 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2015-12-08 09:51:07 PST
Comment on attachment 266892 [details]
Patch for landing

Clearing flags on attachment: 266892

Committed r193757: <http://trac.webkit.org/changeset/193757>
Comment 5 WebKit Commit Bot 2015-12-08 09:51:10 PST
All reviewed patches have been landed.  Closing bug.