- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following .cpp does not compile under Visual Studio in a Debug build:
#define _CRTDBG_MAP_ALLOC
#include
#include
Reason: crtdbg.h provides macros for malloc() and free() that track the file and line number of allocations when linking with the Debug heap (Multithreaded Debug, or Multithreaded Debug DLL). Certain TBB classes have member functions with the same name as the standard C library functions. For example:
class allocate_continuation_proxy { void free(); }
Workaround: undefine free before including certain tbb headers when using the MSVC Debug Heap.
A better solution would be to rename free() in all tbb classes (perhaps "deallocate"?).
#define _CRTDBG_MAP_ALLOC
#include
#include
Reason: crtdbg.h provides macros for malloc() and free() that track the file and line number of allocations when linking with the Debug heap (Multithreaded Debug, or Multithreaded Debug DLL). Certain TBB classes have member functions with the same name as the standard C library functions. For example:
Workaround: undefine free before including certain tbb headers when using the MSVC Debug Heap.
A better solution would be to rename free() in all tbb classes (perhaps "deallocate"?).
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page