Bug 215030 - Use OS defined value for size of address space on Darwin
Summary: Use OS defined value for size of address space on Darwin
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-31 13:04 PDT by Keith Miller
Modified: 2020-07-31 14:00 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.58 KB, patch)
2020-07-31 13:14 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (1.73 KB, patch)
2020-07-31 13:17 PDT, Keith Miller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2020-07-31 13:04:10 PDT
Use OS defined value for size of address space on Darwin
Comment 1 Keith Miller 2020-07-31 13:14:08 PDT
Created attachment 405730 [details]
Patch
Comment 2 Keith Miller 2020-07-31 13:17:07 PDT
Created attachment 405731 [details]
Patch
Comment 3 Yusuke Suzuki 2020-07-31 13:25:50 PDT
Comment on attachment 405731 [details]
Patch

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

> Source/WTF/wtf/PlatformOS.h:39
> +#include <mach/vm_param.h>

I guess it does not work IIRC: Platform.h can be included when processing sandbox definitions IIRC. So we cannot include any C / C++ things in Platform.h and dependent headers.

> Source/WTF/wtf/PlatformOS.h:143
> +#define WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH (64 - WTF::clzConstexpr(MACH_VM_MAX_ADDRESS))

Unfortunately, MACH_VM_MAX_ADDRESS is broken: MACH_VM_MAX_ADDRESS is beyond 32bit even in ARM64_32.
In this case, this is OK since it is inside `CPU(ADDRESS64)`, but it would be possible that this macro returns broken value...
Comment 4 Keith Miller 2020-07-31 14:00:44 PDT
Oh, that's gross... nvm then.