Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
openmp/runtime/src/kmp_wrapper_malloc.h
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | /* Depending on build mode (debug or release), malloc_src_loc is declared with | ||||
... malloc_src_loc( size KMP_SRC_LOC_PARM ); // or KMP_SRC_LOC_CURR | ... malloc_src_loc( size KMP_SRC_LOC_PARM ); // or KMP_SRC_LOC_CURR | ||||
Compiler issues warning/error "too few arguments in macro invocation". | Compiler issues warning/error "too few arguments in macro invocation". | ||||
Declaring two macros, malloc_src_loc() and _malloc_src_loc(), overcomes the | Declaring two macros, malloc_src_loc() and _malloc_src_loc(), overcomes the | ||||
problem. */ | problem. */ | ||||
#if KMP_DEBUG | #if KMP_DEBUG | ||||
#if KMP_OS_WINDOWS && _DEBUG | #if KMP_OS_WINDOWS && _DEBUG && !defined(__MINGW32__) | ||||
// KMP_DEBUG != _DEBUG. MS debug RTL is available only if _DEBUG is defined. | // KMP_DEBUG != _DEBUG. MS debug RTL is available only if _DEBUG is defined. | ||||
// Windows* OS has native memory debugging capabilities. Enable them. | // Windows* OS has native memory debugging capabilities. Enable them. | ||||
#include <crtdbg.h> | #include <crtdbg.h> | ||||
#define KMP_MEM_BLOCK _CLIENT_BLOCK | #define KMP_MEM_BLOCK _CLIENT_BLOCK | ||||
#define malloc(size) _malloc_dbg((size), KMP_MEM_BLOCK, __FILE__, __LINE__) | #define malloc(size) _malloc_dbg((size), KMP_MEM_BLOCK, __FILE__, __LINE__) | ||||
Show All 31 Lines |