Skip to content
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

determine allocator page/frame provider API #19

Open
hawkw opened this issue Jan 21, 2018 · 7 comments
Open

determine allocator page/frame provider API #19

hawkw opened this issue Jan 21, 2018 · 7 comments
Assignees
Labels

Comments

@hawkw
Copy link
Member

hawkw commented Jan 21, 2018

see #17 (comment)

@hawkw hawkw self-assigned this Jan 21, 2018
@hawkw hawkw added the design label Jan 21, 2018
@hawkw
Copy link
Member Author

hawkw commented Jan 21, 2018

i think this trait ought to have an associated constant for the size of frames allocated (and arch cache line size?) so we don't need to know that in ALARM ...

@hawkw
Copy link
Member Author

hawkw commented Jan 21, 2018

currently up in the air:

  • mutability/thread safety:
    • do we put the frame allocator in a mutex and take &mut self, or have the allocator own a mutex/cell and take &self?
    • this needs to be consistent with the allocator api ---> check what the stdlib does
  • do we return Option<Frame> or Result<Frame, AllocErr>?
    • since page allocations are all the same size, we don't need to return a Layout when we OOM, all alloc requests are the same size, so we don't need AllocErr
    • similarly, we should never have to return the AllocErr::Unsupported case...
    • but, AllocErr seems more semantic than Option...

@hawkw
Copy link
Member Author

hawkw commented Jan 21, 2018

would welcome input from @croyzor et al. on this...

@hawkw
Copy link
Member Author

hawkw commented Jan 21, 2018

so the allocator API takes &mut self, which goes somewhat counter to my opinion that the frame allocator implementor ought to own the mutex strategy. hrm.

@hawkw
Copy link
Member Author

hawkw commented Jan 22, 2018

i think if we add a FRAME_SIZE constant to the frame provider trait, we can bound Frame: Into<*mut [u8; FRAME_SIZE]> or something, which seems ideologically correct to me.

@hawkw
Copy link
Member Author

hawkw commented Jan 22, 2018

Started: #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant