Skip to content

Skip getting PAGE_SIZE when defined as macro#81

Open
ptrcnull wants to merge 2 commits intoROCm:masterfrom
ptrcnull:page-size
Open

Skip getting PAGE_SIZE when defined as macro#81
ptrcnull wants to merge 2 commits intoROCm:masterfrom
ptrcnull:page-size

Conversation

@ptrcnull
Copy link

@ptrcnull ptrcnull commented Feb 27, 2023

In some cases, e.g. when using musl libc, PAGE_SIZE is defined as a macro
To avoid compilation errors, only get PAGE_SIZE with sysconf when it's not defined

See #65

alexsierrag and others added 2 commits June 13, 2022 17:12
This env variable sets the max VA alignment order size as
"PAGE_SIZE * 2^alignment order" during mapping. By default the order
size is set to 9(2MB).

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Change-Id: I01ae4e0963f4d21c7c367464e60f865bc58d7fac
(cherry picked from commit f6f1350)
In some cases, e.g. [when using musl libc][1], PAGE_SIZE is defined as a macro
To avoid compilation errors, only get PAGE_SIZE with sysconf when it's not defined

[1]: https://elixir.bootlin.com/musl/v1.2.3/source/include/limits.h#L97
@ptrcnull
Copy link
Author

(if a "rename this to something else" approach is preferred in this case, let me know)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants