Skip to content
Snippets Groups Projects

Centralize page size info in platform abstraction

Merged Peter Limkilde Svendsen requested to merge plimkilde/relibc:centralize-page-size into master

Page size is currently hardcoded independently in header::unistd and in ld_so. This MR centralizes page size info in a new method, getpagesize(), in the Pal trait.

dlmalloc also needs to know about page size but will grab it the canonical POSIX way, sysconf(_SC_PAGE_SIZE).

The new getpagesize() method does not directly correspond to a POSIX-specified function. Internally in relibc, page size is generally needed as a usize, which is what the implemented method provides. The getpagesize name already exists as a legacy POSIX function returning an int, and it seems the Linux kernel on some platforms (alpha, ia64, m68k, sparc) has a getpagesize syscall, returning either int or long.

For maximum flexibility, I've implemented a method rather than an associated constant. Let me know if you disagree with the design decisions here.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
Please register or sign in to reply
Loading