Jump to content

[SOLVED] Engine will not compile without USE_MEMORY preprocessor definition


photo

Recommended Posts

Posted

I was experimenting with enabling and disabling different preprocessor definitions. I disabled USE_MEMORY and found that the engine project would not compile without it: 

"error C2653: 'Memory' : is not a class or namespace name" in many source files.

Posted

Thanks for pointing this out. I just checked and most of the build errors seem to be caused by using our own memcpy() and memset() implementations. While these were useful and a bit quicker a while ago, nowadays they might be redundant. We're going to re-benchmark and either remove them, or add wrappers, so that the engine builds with disabled USE_MEMORY just as well.

 

Just out of curiosity, why exactly are you trying this type of a build? The reason I'm asking, we pool and speedup somewhat tiny allocations, and wrapper API calls create quite a few of those. So unless you link against another allocator that optimizes for this case, you might suffer a certain performance penalty.

Posted

Hi Andrew.

 

This was mostly just an experiment I tried on a whim. I am trying to track down some memory leaks in our application, and I wanted to rule out Unigine's custom memory allocators and deallocators as being part of the problem. I have worked with other projects using homegrown memory allocation tools and generally found them to be redundant and/or inefficient like you said.

 

I don't think Unigine's custom allocators are necessarily causing problems, but nevertheless I believe each preprocessor definition ought to be optional, and it seems USE_MEMORY currently is required.

  • 2 weeks later...
×
×
  • Create New...