Skip to content

Fix typos in Memory Management chapter#95

Merged
dreamos82 merged 3 commits intodreamportdev:masterfrom
hannahfluch:master
Aug 21, 2024
Merged

Fix typos in Memory Management chapter#95
dreamos82 merged 3 commits intodreamportdev:masterfrom
hannahfluch:master

Conversation

@hannahfluch
Copy link
Copy Markdown
Contributor

A couple of typo and grammar fixes across the memory management chapter.

* It can suffer from fragmentation. Basically there can be a lot of small freed areas that the allocator will not be able to use because of their size. A partial solution to this problem is described in the next paragraph.

Another thing worth doing to improve readability of the code is replace the direct pointer access with a more elegant data structure. This lets us add more fields (as we will in the next paragraph) as needed.
Another thing worth doing to improve readability of the code by replacing the direct pointer access with a more elegant data structure. This lets us add more fields (as we will in the next paragraph) as needed.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm happy with this change, but can you double check the sentence flow? Because the sentence starts with "Another thing worth doing ..." looks like something is missing? (i'm not native speaker so maybe it is correct)


* Remember that every node has some overhead, so when splitting we shouldn't have nodes smaller (or equal to) than `sizeof(Heap_Node)`, because otherwise they will never be allocated.
* It's a good idea to have a minimum size for the memory a chunk can contain, to avoid having a large number of nodes and for easy alignment later on. For example if the minimum_allocable_size is 0x20 bytes, and we want to allocate 5 bytes, we will still receive a memory block of `0x20` bytes. The program may not know it was returned `0x20` bytes, but that is okay. What exactly value should be used for it is implementatin specific, values of `0x10` and `0x20` are popular.
* It's a good idea to have a minimum size for the memory a chunk can contain, to avoid having a large number of nodes and for easy alignment later on. For example if the minimum_allocatable_size is 0x20 bytes, and we want to allocate 5 bytes, we will still receive a memory block of `0x20` bytes. The program may not know it was returned `0x20` bytes, but that is okay. What exactly value should be used for it is implementation specific, values of `0x10` and `0x20` are popular.
Copy link
Copy Markdown
Member

@dreamos82 dreamos82 Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that minimum_allocatable_size could be rendered as code (minimum_allocatable_size).

@dreamos82
Copy link
Copy Markdown
Member

Thanks a million for your contribution, just left two minor comments.
Also feel free to add yourself in the Acknowledgment section.

@hannahfluch
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback, I've fixed the issues accordingly :)

@dreamos82
Copy link
Copy Markdown
Member

Thanks again.
If you want you can add yourself the acknowledgments section here? https://github.com/dreamportdev/Osdev-Notes/blob/master/99_Appendices/I_Acknowledgments.md (you can use this PR) or i can add you next time i'll update the notes (of if you don't want to be added just let me know).

I'll wait for your reply/action before merging

@dreamos82
Copy link
Copy Markdown
Member

Thanks again.
You spotted a lot of typos! Great Job!

@dreamos82 dreamos82 merged commit ab5caf0 into dreamportdev:master Aug 21, 2024
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