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

To do #1: Memory page allocation #1

Closed
vercas opened this issue Apr 26, 2015 · 2 comments
Closed

To do #1: Memory page allocation #1

vercas opened this issue Apr 26, 2015 · 2 comments
Assignees
Milestone

Comments

@vercas
Copy link
Owner

vercas commented Apr 26, 2015

I will be using the page map for info and O(1) deallocation of a single page (instant check).
A stack will be used for storing free and caching page indices. This allows O(1) allocation of a single page.

Reserved pages should stay forever reserved, so there is no point in storing them in a stack.
Used pages don't need specific storage. When used pages need to be used (e.g. reallocation to make room for consecutive pages), the map needs to be looped over anyway.

I do not believe I will need to allocate consecutive physical pages often, and I really do not like the implications of every algorithm that would allow quicker multi-page allocation.

The same "stack" will contain both free and caching pages, but the stack will have two "tops". The caching pages sit above the free ones.
E.g. when a free page is popped, the free top decrements, the top caching page is written in its place and the caching top decrements. Performance should be satisfactory.

@vercas vercas added this to the Babysteps milestone Apr 26, 2015
@vercas vercas added the todo label Apr 26, 2015
@vercas vercas self-assigned this Apr 26, 2015
vercas added a commit that referenced this issue Apr 28, 2015
- Added ability to write very simple formatteed output to terminals;

- Added debug functions: Assert and CatchFire;

- Added a decent assert macro;

- Fixed a few mistakes in the page allocator...

... working towards #1 and #8.
vercas added a commit that referenced this issue May 4, 2015
@vercas
Copy link
Owner Author

vercas commented May 11, 2015

Appears to be done.

@vercas vercas closed this as completed May 11, 2015
@vercas
Copy link
Owner Author

vercas commented May 15, 2015

Clearly this issue is not yet solved!

@vercas vercas reopened this May 15, 2015
vercas added a commit that referenced this issue May 15, 2015
Hopefully the final nail in the coffin of todo #1. The current solution (instancing one allocation space per available map entry) is a bit crude. Improvements may be made in the future (#12). For now, it suffices.
@vercas vercas closed this as completed May 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant