Title: Use rustix/windows-sys for page size; drop maplit & page_size by joshuamegnauth54 · Pull Request #7876 · RustPython/RustPython · GitHub
Open Graph Title: Use rustix/windows-sys for page size; drop maplit & page_size by joshuamegnauth54 · Pull Request #7876 · RustPython/RustPython
X Title: Use rustix/windows-sys for page size; drop maplit & page_size by joshuamegnauth54 · Pull Request #7876 · RustPython/RustPython
Description: The page_size crate is a simple libc wrapper for Unix and uses winapi-rs for Windows. windows-sys and windows-rs are the modern alternatives for winapi-rs. Both crates are maintained by Microsoft - they're official. Getting the page size for Unix is a simple call. Rustix can do it safely for us. Windows is effectively the same. Besides Unix and Windows, I also added the page size for wasm32 which the page_size crate did not support. Rust has a built-in API for wasm32's page size, so I didn't add any new dependencies. Finally, I dropped maplit which is seven years old and only used in one place. Using collect() with a single item iterator is better in this case because Rust can optimize it. maplist called HashMap::insert which would over allocate to amortize future allocs. Summary by CodeRabbit Chores Removed unused dependencies and enabled an additional feature on a workspace dependency. Chores Added explicit, platform-specific page-size and allocation-granularity helpers and updated the memory-mapping layer so Python-visible PAGESIZE and ALLOCATIONGRANULARITY use those helpers (PAGESIZE behavior changed for wasm32).
Open Graph Description: The page_size crate is a simple libc wrapper for Unix and uses winapi-rs for Windows. windows-sys and windows-rs are the modern alternatives for winapi-rs. Both crates are maintained by Microsoft -...
X Description: The page_size crate is a simple libc wrapper for Unix and uses winapi-rs for Windows. windows-sys and windows-rs are the modern alternatives for winapi-rs. Both crates are maintained by Microsoft -...
Opengraph URL: https://github.com/RustPython/RustPython/pull/7876
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0e5ffeba-e59f-9827-884b-579b87d3b35e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 87BA:11110:3BFF5B:524645:6A61060C |
| html-safe-nonce | f376a647635c1a71a3a4b2999e7fc3b98d214fa1a9892c176eaa6f471e155828 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0JBOjExMTEwOjNCRkY1Qjo1MjQ2NDU6NkE2MTA2MEMiLCJ2aXNpdG9yX2lkIjoiMTE4MzQ3Njc3MTMxODcyODIwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 599ce7bdc0d968e4242c9342bd525262f53dd3186795476d7eab9f9b4e13c2f0 |
| hovercard-subject-tag | pull_request:3693024629 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/7876/files |
| twitter:image | https://avatars.githubusercontent.com/u/48846352?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/48846352?s=400&v=4 |
| og:image:alt | The page_size crate is a simple libc wrapper for Unix and uses winapi-rs for Windows. windows-sys and windows-rs are the modern alternatives for winapi-rs. Both crates are maintained by Microsoft -... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9029e642b81338577ec563d0cede79b18d6f1471b9ecdd8e364313b9cc67dd06 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0af5dc40dcb0f82accd92a80d9517702c13746f0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width