Core: remove WITH_CXX_GUARDEDALLOC option
This implements the proposal from #124512. For that it contains the following changes: * Remove the global override of `new`/`delete` when `WITH_CXX_GUARDEDALLOC` was enabled. * Always use `MEM_CXX_CLASS_ALLOC_FUNCS` where it is currently used. This used to be guarded by `WITH_CXX_GUARDEDALLOC` in some but not all cases. This means that a few classes which didn't use our guarded allocator by default before, are now using it. Pull Request: https://projects.blender.org/blender/blender/pulls/130181
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
set(INC
|
||||
.
|
||||
intern
|
||||
../guardedalloc
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
#ifndef __DUALCON_H__
|
||||
#define __DUALCON_H__
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
# include "MEM_guardedalloc.h"
|
||||
#endif
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -33,9 +33,7 @@ class VirtualMemoryAllocator {
|
||||
virtual int getAll() = 0;
|
||||
virtual int getBytes() = 0;
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:VirtualMemoryAllocator")
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -194,9 +192,7 @@ template<int N> class MemoryAllocator : public VirtualMemoryAllocator {
|
||||
return N;
|
||||
};
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:MemoryAllocator")
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* __MEMORYALLOCATOR_H__ */
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
|
||||
#include "GeoCommon.h"
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
# include "MEM_guardedalloc.h"
|
||||
#endif
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
/*
|
||||
* Virtual class for input file readers
|
||||
@@ -44,9 +42,7 @@ class ModelReader {
|
||||
|
||||
virtual void printInfo() = 0;
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:ModelReader")
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* __MODELREADER_H__ */
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
# include "MEM_guardedalloc.h"
|
||||
#endif
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "Projections.h"
|
||||
#include <math.h>
|
||||
|
||||
@@ -106,9 +106,7 @@ class CubeTriangleIsect {
|
||||
|
||||
float getIntersectionPrimary(int edgeInd) const;
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:CubeTriangleIsect")
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* __PROJECTIONS_H__ */
|
||||
|
||||
@@ -75,9 +75,7 @@ class GridQueue {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:GridQueue")
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* __QUEUE_H__ */
|
||||
|
||||
@@ -24,9 +24,7 @@ class Cubes {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:Cubes")
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* __CUBES_H__ */
|
||||
|
||||
@@ -143,9 +143,7 @@ class DualConInputReader : public ModelReader {
|
||||
return sizeof(DualConInputReader);
|
||||
}
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:DualConInputReader")
|
||||
#endif
|
||||
};
|
||||
|
||||
void *dualcon(const DualConInput *input_mesh,
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
# include "MEM_guardedalloc.h"
|
||||
#endif
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "octree.h"
|
||||
#include <Eigen/Dense>
|
||||
|
||||
@@ -1390,9 +1390,7 @@ class Octree {
|
||||
return npar;
|
||||
}
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:Octree")
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* __OCTREE_H__ */
|
||||
|
||||
Reference in New Issue
Block a user