Support WITH_CXX_GUARDEDALLOC for dualcon library
authorCampbell Barton <ideasman42@gmail.com>
Sun, 4 Aug 2013 17:58:17 +0000 (17:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 4 Aug 2013 17:58:17 +0000 (17:58 +0000)
13 files changed:
intern/dualcon/dualcon.h
intern/dualcon/intern/GeoCommon.h
intern/dualcon/intern/MemoryAllocator.h
intern/dualcon/intern/ModelReader.h
intern/dualcon/intern/Projections.cpp
intern/dualcon/intern/Projections.h
intern/dualcon/intern/Queue.h
intern/dualcon/intern/cubes.h
intern/dualcon/intern/dualcon_c_api.cpp
intern/dualcon/intern/manifold_table.h
intern/dualcon/intern/marching_cubes_table.h
intern/dualcon/intern/octree.cpp
intern/dualcon/intern/octree.h

index 1c3d31b6625684b66103d264c256b470af7bacd8..c1452a72970b95b5eab5ea2691fc57287b836706 100644 (file)
 #ifndef __DUALCON_H__
 #define __DUALCON_H__
 
+#ifdef WITH_CXX_GUARDEDALLOC
+#  include "MEM_guardedalloc.h"
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index 9f5a99e9e20684e9dbde7ceeeba4df43e238a71d..45f60a1060a7bd34cd15a21e06d88af6cba08b05 100644 (file)
@@ -20,8 +20,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef GEOCOMMON_H
-#define GEOCOMMON_H
+#ifndef __GEOCOMMON_H__
+#define __GEOCOMMON_H__
 
 #define UCHAR unsigned char
 #define USHORT unsigned short
@@ -61,4 +61,4 @@ typedef struct {
 } BoundingBoxf;
 
 
-#endif
+#endif  /* __GEOCOMMON_H__ */
index e673d9498d202f4621843fadca268ce7fd38a591..29d82aeb3a2d0fd77264c657cee0187e87cb368b 100644 (file)
@@ -20,8 +20,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef MEMORYALLOCATOR_H
-#define MEMORYALLOCATOR_H
+#ifndef __MEMORYALLOCATOR_H__
+#define __MEMORYALLOCATOR_H__
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -53,6 +53,11 @@ virtual void printInfo( ) = 0;
 virtual int getAllocated( ) = 0;
 virtual int getAll( ) = 0;
 virtual int getBytes( ) = 0;
+
+#ifdef WITH_CXX_GUARDEDALLOC
+       MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:VirtualMemoryAllocator")
+#endif
+
 };
 
 /**
@@ -216,6 +221,11 @@ int getBytes( )
 {
        return N;
 };
-};
 
+#ifdef WITH_CXX_GUARDEDALLOC
+       MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:MemoryAllocator")
 #endif
+
+};
+
+#endif  /* __MEMORYALLOCATOR_H__ */
index 993c5756531b43bd655163a4746cb58b4ca2a4bb..a72368ef4dc2ecd3e8524a1b327adc947de9ad90 100644 (file)
@@ -20,8 +20,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef MODELREADER_H
-#define MODELREADER_H
+#ifndef __MODELREADER_H__
+#define __MODELREADER_H__
 
 #include "GeoCommon.h"
 
@@ -59,7 +59,11 @@ virtual int getNumVertices( ) = 0;
 virtual void getNextVertex(float v[3]) = 0;
 
 virtual void printInfo( ) = 0;
-};
-
 
+#ifdef WITH_CXX_GUARDEDALLOC
+       MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:ModelReader")
 #endif
+
+};
+
+#endif  /* __MODELREADER_H__ */
index f00d998591f01706a3d6a05135e6a26ba7de0077..e85589e3ff55febd5e8190decfa2a05c31a8594c 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
+#ifdef WITH_CXX_GUARDEDALLOC
+#  include "MEM_guardedalloc.h"
+#endif
+
 #include <math.h>
 #include "Projections.h"
 
index 2cc3320f8e4e950324a36ef555bf3c018ed14e2f..a5086ddca39be744b6de38fe568dde86293c6382 100644 (file)
@@ -20,8 +20,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef PROJECTIONS_H
-#define PROJECTIONS_H
+#ifndef __PROJECTIONS_H__
+#define __PROJECTIONS_H__
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -125,6 +125,11 @@ public:
        int isIntersectingPrimary(int edgeInd) const;
 
        float getIntersectionPrimary(int edgeInd) const;
-};
 
+#ifdef WITH_CXX_GUARDEDALLOC
+       MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:CubeTriangleIsect")
 #endif
+
+};
+
+#endif  /* __PROJECTIONS_H__ */
index a2b5b46c72c783029efb25207e7700705532363b..098b883da32343252c4191def9ca39f9eb6660fb 100644 (file)
@@ -20,8 +20,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef QUEUE_H
-#define QUEUE_H
+#ifndef __QUEUE_H__
+#define __QUEUE_H__
 
 struct gridQueueEle {
        int x, y, z;
@@ -99,10 +99,10 @@ int popQueue(int st[3], int& dir)
        return 1;
 }
 
-};
-
-
-
+#ifdef WITH_CXX_GUARDEDALLOC
+       MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:GridQueue")
+#endif
 
+};
 
-#endif
+#endif  /* __QUEUE_H__ */
index 8b5125e261a0ddd2e8526b6400599e0a50bd1126..991edebda7ed0898936229e36bc0338395f75c30 100644 (file)
@@ -20,8 +20,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef CUBES_H
-#define CUBES_H
+#ifndef __CUBES_H__
+#define __CUBES_H__
 
 #include "marching_cubes_table.h"
 
@@ -41,6 +41,11 @@ void getTriangle(int mask, int index, int indices[3])
        for (int i = 0; i < 3; i++)
                indices[i] = marching_cubes_tris[mask][index][i];
 }
-};
 
+#ifdef WITH_CXX_GUARDEDALLOC
+       MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:Cubes")
 #endif
+
+};
+
+#endif  /* __CUBES_H__ */
index c96415bfb54f44011a36b26e5ddb1a505fda720f..6c3ec4dcc3bc5fedef098a8b6420125124b38c36 100644 (file)
@@ -185,6 +185,11 @@ void printInfo() {
 int getMemory() {
        return sizeof(DualConInputReader);
 }
+
+#ifdef WITH_CXX_GUARDEDALLOC
+       MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:DualConInputReader")
+#endif
+
 };
 
 void *dualcon(const DualConInput *input_mesh,
index 1827623f5ff413d30600cc499ceb02ed766bea90..89779fdfe4edf93504c23e57014c2f0428659824 100644 (file)
@@ -20,8 +20,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef MANIFOLD_TABLE_H
-#define MANIFOLD_TABLE_H
+#ifndef __MANIFOLD_TABLE_H__
+#define __MANIFOLD_TABLE_H__
 
 typedef struct {
        int comps;
@@ -30,4 +30,4 @@ typedef struct {
 
 extern const ManifoldIndices manifold_table[256];
 
-#endif
+#endif  /* __MANIFOLD_TABLE_H__ */
index e45e1c609244198940e69b912d1e395cc871a050..e1e44a50961ff8a9cd7dbbee334c7a8abf0e4bf1 100644 (file)
@@ -20,8 +20,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef MARCHING_CUBES_TABLE_H
-#define MARCHING_CUBES_TABLE_H
+#ifndef __MARCHING_CUBES_TABLE_H__
+#define __MARCHING_CUBES_TABLE_H__
 
 /* number of configurations */
 #define TOTCONF 256
index 49c50c8240d4e872ef72566e9c38beb898068dc1..6567b2873a2ddb721f7f29aabfdc612ef9e0d04e 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
+#ifdef WITH_CXX_GUARDEDALLOC
+#  include "MEM_guardedalloc.h"
+#endif
+
 #include "octree.h"
 #include <Eigen/Dense>
 #include <limits>
index 544048249de4655d9259ca3d5cf2ff3f62266f77..67eaf3a650b8b32ce71d8229e2643b178502b00f 100644 (file)
@@ -20,8 +20,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef OCTREE_H
-#define OCTREE_H
+#ifndef __OCTREE_H__
+#define __OCTREE_H__
 
 #include <cassert>
 #include <cstring>
@@ -1388,6 +1388,10 @@ class Octree
                removeInternal(num - 1, par);
                return npar;
        }
-};
 
+#ifdef WITH_CXX_GUARDEDALLOC
+       MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:Octree")
 #endif
+};
+
+#endif  /* __OCTREE_H__ */