- fix for BGE warnings
[blender.git] / intern / string / STR_String.h
index 941430fd976139fe0ebc94307a3bdff902040e2e..a5e7a0721ec4f4cd5f1d7f8fc333617bce48454e 100644 (file)
@@ -50,6 +50,9 @@
 
 using namespace std;
 
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
 
 class STR_String;
 
@@ -191,6 +194,13 @@ protected:
        char   *pData;                                                                                                  // -> STR_String data
        int        Len;                                                                                                         // Data length
        int        Max;                                                                                                         // Space in data buffer
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+       void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "CXX:STR_String"); }
+       void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
 };
 
 inline  STR_String operator+(rcSTR_String    lhs, rcSTR_String   rhs)  { return STR_String(lhs.ReadPtr(), lhs.Length(), rhs.ReadPtr(), rhs.Length()); }