Memory Classes

Memory Classes

Hello,First is it good idea for a newborn game engine to use havok memory management? in the docs seems like it is encouraged to do so... but im not sure, it clearly says how to customize it all the way around.Second can i use a longer value than HK_MEMORY_CLASS_MAX? i know theres 5 user class at the end in (hkMemoryClassDefinitions) but it would come handy to have a dozen more.Thank you.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello kukobar,

On your first question: whether you should use the Havok Memory Management systems for your game engine depends on several factors:
1) Do you really need it for what you are doing? Starting with new/delete or implementing
your own memory management system might be more useful depending on what you are trying to
achieve/learn and the Havok memory systems might add extra complexities/dependencies to your engine that you might not want to deal with when starting the creation of an engine. (You could always use the Havok Memory Management system later on when you would really need it (ie.: Performance issues or need more statistics information on how your engine uses memory.)
2) Are you also planning to work with Havok Physics/Animation related classes?
3) Do you have the intention to write your own custom hkMemoryAllocator?
4) Will your engine be multi-threaded?
On your second question, yes you could potentially add more user classes to the list. Note that there are not really "user classes" but more
like locations in memory where to store objects that have been marked correspondingly (with a specific "hkMemoryClass").

Let me know if you are still undecisive on whether to use the Havok Memory Management system.
If you want to use it and have any specific issues while doing it or have more questions about the specifics of it,
do not hesitate to let us know.


David G.
Developer Support Engineer

Thank you for answering so quickly! :)

1) whether i need havok's im not sure, but since im planning to use all havok's features (this answers question #2, Animation and Physhics as of right now, later on we will license AI and behavior atleast) and everything else which would be considered as mayor modules like the renderer are being code from scratch,i thought it could be a good idea to keep everything consistent (memory-wise) but that's just my opinion, clearly i'm not expert on momory issues yet :-).

3) not right now, like i said im still researching that topic.

4) Yes, (task based with Intel's TBB)

So doing this would be totally fine right?

enum MyMemoryClasses {
etc, etc


Leave a Comment

Please sign in to add a comment. Not a member? Join today