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

Avoid generic impl trait parameters in BootInfoFrameAllocator #595

Merged
merged 3 commits into from Apr 30, 2019

Conversation

Projects
None yet
1 participant
@phil-opp
Copy link
Owner

commented Apr 30, 2019

The use of impl trait as return value made it very hard to put the BootInfoFrameAllocator in a static, e.g. for accessing it from a page fault handler. See #593 for more information.

This PR makes BootInfoFrameAllocator non-generic. It now has a MemoryMap field and usable_frames method for creating the frame iterator. In an additional field, it keeps track of the last returned frame so that no frame is returned twice.

This might have a bit worse performance because we recreate the iterator on every allocation, but I don't think that this is a problem for the blog for now (also, it doesn't make much sense to optimize for performance without any benchmarks).

Post update in #596.

@phil-opp phil-opp force-pushed the redesign-frame-allocator branch 2 times, most recently from 66324dd to 5fe158b Apr 30, 2019

@phil-opp phil-opp force-pushed the redesign-frame-allocator branch from 5fe158b to 180c77d Apr 30, 2019

@phil-opp phil-opp force-pushed the redesign-frame-allocator branch from 8b864b0 to b5ee446 Apr 30, 2019

@phil-opp phil-opp added the relnotes label Apr 30, 2019

@phil-opp phil-opp merged commit a867450 into post-09 Apr 30, 2019

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
phil-opp.blog_os Build #20190430.23 succeeded
Details

@bors bors bot deleted the redesign-frame-allocator branch Apr 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.