TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
debug.h
Go to the documentation of this file.
1 
13 #ifndef G3D_debug_h
14 #define G3D_debug_h
15 
16 #include "G3D/platform.h"
17 #ifdef _MSC_VER
18  #include <crtdbg.h>
19 #endif
20 
21 #include "G3D/debugPrintf.h"
22 #include "G3D/debugAssert.h"
23 
24 namespace G3D {
25 
26 #ifdef _MSC_VER
27  // Turn off 64-bit warnings
28 # pragma warning(push)
29 # pragma warning( disable : 4312)
30 # pragma warning( disable : 4267)
31 # pragma warning( disable : 4311)
32 #endif
33 
34 
38 inline bool isValidHeapPointer(const void* x) {
39  #ifdef _MSC_VER
40  return
41  (x != NULL) &&
42  (x != (void*)0xcccccccc) && (x != (void*)0xdeadbeef) && (x != (void*)0xfeeefeee) &&
43  (x != (void*)0xcdcdcdcd) && (x != (void*)0xabababab) && (x != (void*)0xfdfdfdfd);
44  #else
45  return x != NULL;
46  #endif
47 }
48 
54 inline bool isValidPointer(const void* x) {
55  #ifdef _MSC_VER
56  return (x != NULL) &&
57  (x != (void*)0xcccccccc) && (x != (void*)0xdeadbeef) && (x != (void*)0xfeeefeee) &&
58  (x != (void*)0xcdcdcdcd) && (x != (void*)0xabababab) && (x != (void*)0xfdfdfdfd);
59  #else
60  return x != NULL;
61  #endif
62 }
63 
64 #ifdef _MSC_VER
65 # pragma warning(pop)
66 #endif
67 
68 }
69 
70 #endif
Definition: AABox.h:25
arena_t NULL
Definition: jemalloc_internal.h:624
bool isValidPointer(const void *x)
Definition: debug.h:54
G3D::int16 x
Definition: Vector2int16.h:37
bool isValidHeapPointer(const void *x)
Definition: debug.h:38