Changeset 211241 in webkit


Ignore:
Timestamp:
Jan 26, 2017 4:56:44 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: iOS: Memory timeline shows impossible values for Page size (underflowed)
https://bugs.webkit.org/show_bug.cgi?id=167468
<rdar://problem/30099051>

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2017-01-26
Reviewed by Andreas Kling.

  • page/cocoa/ResourceUsageThreadCocoa.mm:

(WebCore::vmPageSize):
This value matches the sysctl value we were attempting to access, and is
the most appropriate when dealing with mach APIs, as we are using here.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r211240 r211241  
     12017-01-26  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: iOS: Memory timeline shows impossible values for Page size (underflowed)
     4        https://bugs.webkit.org/show_bug.cgi?id=167468
     5        <rdar://problem/30099051>
     6
     7        Reviewed by Andreas Kling.
     8
     9        * page/cocoa/ResourceUsageThreadCocoa.mm:
     10        (WebCore::vmPageSize):
     11        This value matches the sysctl value we were attempting to access, and is
     12        the most appropriate when dealing with mach APIs, as we are using here.
     13
    1142017-01-26  Jer Noble  <jer.noble@apple.com>
    215
  • trunk/Source/WebCore/page/cocoa/ResourceUsageThreadCocoa.mm

    r207896 r211241  
    3535#include <mach/vm_statistics.h>
    3636#include <runtime/VM.h>
    37 #include <sys/sysctl.h>
    3837
    3938namespace WebCore {
     
    4140static size_t vmPageSize()
    4241{
    43     static size_t pageSize;
    44     static std::once_flag onceFlag;
    45     std::call_once(onceFlag, [&] {
    46         size_t outputSize = sizeof(pageSize);
    47         int status = sysctlbyname("vm.pagesize", &pageSize, &outputSize, nullptr, 0);
    48         ASSERT_UNUSED(status, status != -1);
    49         ASSERT(pageSize);
    50     });
    51     return pageSize;
     42#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
     43    return vm_kernel_page_size;
     44#else
     45    static size_t cached = sysconf(_SC_PAGESIZE);
     46    return cached;
     47#endif
    5248}
    5349
Note: See TracChangeset for help on using the changeset viewer.