-
Notifications
You must be signed in to change notification settings - Fork 59
Add support for Apple Silicon #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
And add FIXMEs for things that might also need updates.
legacy/reap/regionheap.h
Outdated
| class LeaHeap2 : | ||
| public | ||
| Threshold<4096, | ||
| Threshold<4096, // FIXME: is this page-size dependent? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bpowers there were a couple of parts where I wasn't sure if the number was referring to the page size or another value, like here and below. I'm guessing this one should be changed to the page size (though not sure about the others), but do you know for sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular heap layer is legacy code; I'm not sure it's being used by anyone. IIRC the size here was chosen arbitrarily (by me) but it might make sense to parameterize it by the system page size.
| // macOS on Apple Silicon aligns 16K pages to a 16K boundary. | ||
| // FIXME: is this the correct alignment? | ||
| enum { Size = 16 * 1024UL }; | ||
| enum { Alignment = 16 * 1024UL }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to find any documentation about the alignment for Apple Silicon pages. I'm assuming they're 16K aligned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is correct. I'm not sure if vm_page_size is constexpr but if so, we could use that instead of hardcoding the numbers. Anyway, probably should also put in an assertion (if one is not there already) in the call to mmap to verify alignment and size.
| // macOS on Apple Silicon aligns 16K pages to a 16K boundary. | ||
| // FIXME: is this the correct alignment? | ||
| enum { Size = 16 * 1024UL }; | ||
| enum { Alignment = 16 * 1024UL }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is correct. I'm not sure if vm_page_size is constexpr but if so, we could use that instead of hardcoding the numbers. Anyway, probably should also put in an assertion (if one is not there already) in the call to mmap to verify alignment and size.
legacy/reap/regionheap.h
Outdated
| class LeaHeap2 : | ||
| public | ||
| Threshold<4096, | ||
| Threshold<4096, // FIXME: is this page-size dependent? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular heap layer is legacy code; I'm not sure it's being used by anyone. IIRC the size here was chosen arbitrarily (by me) but it might make sense to parameterize it by the system page size.
This is part of adding Apple Silicon support to Mesh.