MMGR Questions, code use and thread-saftey
- by chadb
1) Is MMGR thread safe?
2) I was hoping someone could help me understand some code. I am looking at something where a macro is used, but I don't understand the macro. I know it contains a function call and an if check, however, the function is a void function. How does wrapping "(m_setOwner (FILE,_LINE_,FUNCTION),false)" ever change return types?
#define someMacro (m_setOwner(__FILE__,__LINE__,__FUNCTION__),false) ? NULL : new ...
void m_setOwner(const char *file, const unsigned int line, const char *func);
3) What is the point of the reservoir?
4) On line 770 ("void *operator new(size_t reportedSize)" there is the line
"// ANSI says: allocation requests of 0 bytes will still return a valid value"
Who/what is ANSI in this context? Do they mean the standards?
5) This is more of C++ standards, but where does "reportedSize" come from for "void *operator new(size_t reportedSize)"?
6) Is this the code that is actually doing the allocation needed?
"au-actualAddress = malloc(au-actualSize);"