(Answered)Heap/Pool Dynamic Memory Allocation Implementation
Posted: Wed Jun 21, 2017 6:06 am
Hello everybody!
I have a conceptual dilemma on how to implement this thing. I don't know where to start, what to look for. I already searched quite a few online pages, but they don't talk about the implementation itself.
How to implement it? To use a double linked list? I know for sure that I do not and will not want port an existing allocator, just don't try to convince me. Do I need to look at other OS specific implementations and try to kind of
"clone" them or should I come up with my own idea? The problem is that I don't even know how it technically works and what it does underneath.
I have quite a few tabs open with different source files to look at, but the problem is that they mostly rely on James Molloy's implementation. Is that implementation even worth taking a look at?
I know this is one really big question, I really need help. I can't continue working on my OS until I have something as important as this working perfectly.
Also I've read about best fist, first fit algorithms. I for sure don't want to waste any memory to fragmentation.
So I would have to find the hole that satisfies the request, take requested + overhead and then split that hole leaving the extra for future allocation.
My primary goal right now is the be able to understand every little detail on how it works and how to implement it. Thanks for understanding!
I have a conceptual dilemma on how to implement this thing. I don't know where to start, what to look for. I already searched quite a few online pages, but they don't talk about the implementation itself.
How to implement it? To use a double linked list? I know for sure that I do not and will not want port an existing allocator, just don't try to convince me. Do I need to look at other OS specific implementations and try to kind of
"clone" them or should I come up with my own idea? The problem is that I don't even know how it technically works and what it does underneath.
I have quite a few tabs open with different source files to look at, but the problem is that they mostly rely on James Molloy's implementation. Is that implementation even worth taking a look at?
I know this is one really big question, I really need help. I can't continue working on my OS until I have something as important as this working perfectly.
Also I've read about best fist, first fit algorithms. I for sure don't want to waste any memory to fragmentation.
So I would have to find the hole that satisfies the request, take requested + overhead and then split that hole leaving the extra for future allocation.
My primary goal right now is the be able to understand every little detail on how it works and how to implement it. Thanks for understanding!