First of all, hello everyone! I'm new to the forums, since I only recently purchased Game Coding Complete. I'm not through reading it, by a long shot, but I've been obsessing over something ( preventing me from reading further ).
MrMike states in Chapter 3 that a custom memory manager is prett important to a game engine. I hadn't considered this yet, since all i've been doing so far is muck about with the DirectX SDK.
I understand why it's important, but I can't really get a decent manager going.. Based on some online tutorials I've thrown something together, it's basically a vector of void pointers and a set of functions that allocates new blocks of memory when needed. It works nicely as far as I can tell, I can stick two structs in there, and they'll be packed neatly next to each other.
However, it doesn't seem to improve the speed of memory allocations, as far as I can tell. There's probably something I can do to improve that, but I'll be damned if I know how ;).
Basically my question would be, where can I find more information on memory management? MrMike mentions a lot of books in his further reading section at the end of the chapter, is any of those going to help me understand memory management?
I'd love to read them all, but books can get pretty expensive..
*edit* I have done some things to increase speed. I was calculating free bytes in a block at every call of my allocate() function from scrap, wich was silly, frankly. Using a member variable in the memory manager class to keep track of free bytes, and simply updating it based on the requested allocation size has boosted performance significantly ( it's about 10 X faster in fact ).
However, if anyone has any recommendations regarding information on memory management, I could still really use it, of course :).
MrMike states in Chapter 3 that a custom memory manager is prett important to a game engine. I hadn't considered this yet, since all i've been doing so far is muck about with the DirectX SDK.
I understand why it's important, but I can't really get a decent manager going.. Based on some online tutorials I've thrown something together, it's basically a vector of void pointers and a set of functions that allocates new blocks of memory when needed. It works nicely as far as I can tell, I can stick two structs in there, and they'll be packed neatly next to each other.
However, it doesn't seem to improve the speed of memory allocations, as far as I can tell. There's probably something I can do to improve that, but I'll be damned if I know how ;).
Basically my question would be, where can I find more information on memory management? MrMike mentions a lot of books in his further reading section at the end of the chapter, is any of those going to help me understand memory management?
I'd love to read them all, but books can get pretty expensive..
*edit* I have done some things to increase speed. I was calculating free bytes in a block at every call of my allocate() function from scrap, wich was silly, frankly. Using a member variable in the memory manager class to keep track of free bytes, and simply updating it based on the requested allocation size has boosted performance significantly ( it's about 10 X faster in fact ).
However, if anyone has any recommendations regarding information on memory management, I could still really use it, of course :).
The post was edited 1 time, last by PawnOfEvil ().