"Starting" ???
Is it not obvious by now that our OP friend is in way over his head?
Seriously, no offense is intended, but I'm thinking that a lot more than his experience is required here...
Type: Posts; User: CommonTater
"Starting" ???
Is it not obvious by now that our OP friend is in way over his head?
Seriously, no offense is intended, but I'm thinking that a lot more than his experience is required here...
It's all assigning memory... he's doing what I showed you in message 35 of the thread... writing frames into memory.
The only C function that allocates memory is malloc() and it is dependent upon the underlying operating system.
If you are working on an OS kernel you need to write a complete memory manager, that...
And you should not be surprised if it doesn't work when you un-nest it from all that virtualization...
Virtual machines are pretty good, but they're not perfect...
The big question is "Why?" ... if it's a class assignment or even idle curiosity, ok I get that... but if you think you can second guess a well tested and optimized library you are probably in for a...
Can't answer for linux but on Windows it's easy enough the OS actually provides this as API calls...
Heap Functions (Windows)
Basically you create a private heap... but it also gives you far...
Ahhh... ok, I see how you did it now... interesting experiment but not very practical.
malloc() and free() are already abstractions from the underlying OS allocators... So you end up with...
And exactly how did you inform the C libarary and application calls of this new memory manager?
Unless you're about rewriting the entire library, it's better, safer and probably faster to use...
Won't happen.... You will never implement OS specific behavior without using the underlying OS libraries.