[cgal] update to 6.0.1 (#41845)

This commit is contained in:
Laurent Rineau 2024-10-31 10:35:52 +01:00 committed by GitHub
parent 80dfbfea2f
commit 15a18edd40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 217 deletions

View File

@ -1,212 +0,0 @@
diff --git a/CGAL_Core/include/CGAL/CORE/ExprRep.h b/CGAL_Core/include/CGAL/CORE/ExprRep.h
index 0e721dda16a8..a325930a2ab4 100644
--- a/CGAL_Core/include/CGAL/CORE/ExprRep.h
+++ b/CGAL_Core/include/CGAL/CORE/ExprRep.h
@@ -595,7 +595,7 @@ class CGAL_CORE_EXPORT ConstPolyRep : public ConstRep {
}
void operator delete( void *p, size_t ){
- MemoryPool<ConstPolyRep>::global_allocator().free(p);
+ (MemoryPool<ConstPolyRep>::global_allocator().free)(p);
}
private:
@@ -1248,7 +1248,7 @@ void * AddSubRep<O>::operator new( size_t size)
template <typename O>
void AddSubRep<O>::operator delete( void *p, size_t )
-{ MemoryPool<AddSubRep<O> >::global_allocator().free(p); }
+{ (MemoryPool<AddSubRep<O> >::global_allocator().free)(p); }
/// \typedef AddRep
diff --git a/CGAL_Core/include/CGAL/CORE/Impl.h b/CGAL_Core/include/CGAL/CORE/Impl.h
index 4ff8b4fa3d48..8ae4c53fe7d1 100644
--- a/CGAL_Core/include/CGAL/CORE/Impl.h
+++ b/CGAL_Core/include/CGAL/CORE/Impl.h
@@ -58,7 +58,7 @@
{ return MemoryPool<C<T> >::global_allocator().allocate(size); } \
template <typename T> \
CGAL_INLINE_FUNCTION void C<T>::operator delete( void *p, size_t ) \
- { MemoryPool<C<T> >::global_allocator().free(p); }
+ { (MemoryPool<C<T> >::global_allocator().free)(p); }
#endif
// include some common header files
diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h
index 2db3de8736e1..d218a871bec5 100644
--- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h
+++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h
@@ -73,7 +73,7 @@ class MemoryPool {
void* allocate(std::size_t size);
- void free(void* p);
+ void free BOOST_PREVENT_MACRO_SUBSTITUTION (void* p);
// Access the corresponding static global allocator.
static MemoryPool<T,nObjects>& global_allocator() {
diff --git a/CGAL_Core/include/CGAL/CORE/RealRep.h b/CGAL_Core/include/CGAL/CORE/RealRep.h
index 1c5d0f13a405..f2ec1e90cb3b 100644
--- a/CGAL_Core/include/CGAL/CORE/RealRep.h
+++ b/CGAL_Core/include/CGAL/CORE/RealRep.h
@@ -154,7 +154,7 @@ void * Realbase_for<T>::operator new( size_t size)
template <class T>
void Realbase_for<T>::operator delete( void *p, size_t )
-{ MemoryPool<Realbase_for<T> >::global_allocator().free(p); }
+{ (MemoryPool<Realbase_for<T> >::global_allocator().free)(p); }
typedef Realbase_for<long> RealLong;
typedef Realbase_for<double> RealDouble;
diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h
index d218a871bec5..1cfa96fa93d1 100644
--- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h
+++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h
@@ -116,7 +116,7 @@ void* MemoryPool< T, nObjects >::allocate(std::size_t) {
}
template< class T, int nObjects >
-void MemoryPool< T, nObjects >::free(void* t) {
+void MemoryPool< T, nObjects >::free BOOST_PREVENT_MACRO_SUBSTITUTION (void* t) {
CGAL_assertion(t != 0);
if (t == 0) return; // for safety
if(blocks.empty()){
diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h
index 53f8968f86f4..9a217389d82e 100644
--- a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h
+++ b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h
@@ -116,8 +116,8 @@ void partition_dual_graph(const TriangleMesh& tm,
delete[] eptr;
delete[] eind;
- std::free(npart);
- std::free(epart);
+ (std::free)(npart);
+ (std::free)(epart);
}
template<typename TriangleMesh, typename NamedParameters>
diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h
index 08926a641169..42f8c240f011 100644
--- a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h
+++ b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h
@@ -151,8 +151,8 @@ void partition_graph(const TriangleMesh& tm,
delete[] eptr;
delete[] eind;
- std::free(npart);
- std::free(epart);
+ (std::free)(npart);
+ (std::free)(epart);
}
template<typename TriangleMesh, typename NamedParameters>
diff --git a/CGAL_Core/include/CGAL/CORE/Impl.h b/CGAL_Core/include/CGAL/CORE/Impl.h
index 8ae4c53fe7d1..2e21aab5ac0a 100644
--- a/CGAL_Core/include/CGAL/CORE/Impl.h
+++ b/CGAL_Core/include/CGAL/CORE/Impl.h
@@ -51,7 +51,7 @@
CGAL_INLINE_FUNCTION void *T::operator new( size_t size) \
{ return MemoryPool<T>::global_allocator().allocate(size); } \
CGAL_INLINE_FUNCTION void T::operator delete( void *p, size_t ) \
- { MemoryPool<T>::global_allocator().free(p); }
+ { (MemoryPool<T>::global_allocator().free)(p); }
#define CORE_MEMORY_IMPL_TEMPLATE_WITH_ONE_ARG(C) \
template <typename T> \
CGAL_INLINE_FUNCTION void *C<T>::operator new( size_t size) \
diff --git a/Classification/include/CGAL/Classification/Feature/Elevation.h b/Classification/include/CGAL/Classification/Feature/Elevation.h
index 175b20b6a44e..9ea9f267cc46 100644
--- a/Classification/include/CGAL/Classification/Feature/Elevation.h
+++ b/Classification/include/CGAL/Classification/Feature/Elevation.h
@@ -130,7 +130,7 @@ class Elevation : public Feature_base
std::nth_element (z.begin(), z.begin() + (z.size() / 10), z.end());
dtm_x(i,j) = z[z.size() / 10];
}
- dem.free();
+ (dem.free)();
if (grid.width() * grid.height() > input.size())
values.resize (input.size(), compressed_float(0));
@@ -162,7 +162,7 @@ class Elevation : public Feature_base
values[*it] = v;
}
}
- dtm_x.free();
+ (dtm_x.free)();
}
diff --git a/Classification/include/CGAL/Classification/Feature/Height_above.h b/Classification/include/CGAL/Classification/Feature/Height_above.h
index b59b108c1aca..3c85d27f91e2 100644
--- a/Classification/include/CGAL/Classification/Feature/Height_above.h
+++ b/Classification/include/CGAL/Classification/Feature/Height_above.h
@@ -100,7 +100,7 @@ class Height_above : public Feature_base
std::size_t J = grid.y(i);
values[i] = float(dtm(I,J) - get (point_map, *(input.begin() + i)).z());
}
- dtm.free();
+ (dtm.free)();
}
}
diff --git a/Classification/include/CGAL/Classification/Feature/Height_below.h b/Classification/include/CGAL/Classification/Feature/Height_below.h
index 223719341555..f71195dd3489 100644
--- a/Classification/include/CGAL/Classification/Feature/Height_below.h
+++ b/Classification/include/CGAL/Classification/Feature/Height_below.h
@@ -100,7 +100,7 @@ class Height_below : public Feature_base
std::size_t J = grid.y(i);
values[i] = float(get (point_map, *(input.begin() + i)).z() - dtm(I,J));
}
- dtm.free();
+ (dtm.free)();
}
}
diff --git a/Classification/include/CGAL/Classification/Feature/Vertical_range.h b/Classification/include/CGAL/Classification/Feature/Vertical_range.h
index 45b9c98d3ee7..a4df1591c13f 100644
--- a/Classification/include/CGAL/Classification/Feature/Vertical_range.h
+++ b/Classification/include/CGAL/Classification/Feature/Vertical_range.h
@@ -102,7 +102,7 @@ class Vertical_range : public Feature_base
std::size_t J = grid.y(i);
values[i] = dtm(I,J);
}
- dtm.free();
+ (dtm.free)();
}
}
diff --git a/Classification/include/CGAL/Classification/Image.h b/Classification/include/CGAL/Classification/Image.h
index 084e9572764a..3bd915f0b5d7 100644
--- a/Classification/include/CGAL/Classification/Image.h
+++ b/Classification/include/CGAL/Classification/Image.h
@@ -71,7 +71,7 @@ class Image
{
}
- void free()
+ void free BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
m_raw.reset();
m_sparse.reset();
diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h
index bd5dafbf0171..92a4ac768f58 100644
--- a/Installation/include/CGAL/config.h
+++ b/Installation/include/CGAL/config.h
@@ -37,6 +37,13 @@
#endif
#ifdef CGAL_INCLUDE_WINDOWS_DOT_H
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+// Include support for memory leak detection
+// This is only available in debug mode and when _CRTDBG_MAP_ALLOC is defined.
+// It will include <crtdbg.h> which will redefine `malloc` and `free`.
+# define _CRTDBG_MAP_ALLOC 1
+#endif
// Mimic users including this file which defines min max macros
// and other names leading to name clashes
#include <windows.h>

View File

@ -4,10 +4,8 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO CGAL/cgal
REF v${VERSION}
SHA512 f61e608898d798b90ce07260928b682161f00e964b43b9876ef6604d10c30787a0814e13afde90f7d703efd6b83c61dd4a9d9f50d21068bd50c5c15f94b5755b
SHA512 28963cdbf84d516290da69ca2ad5c90ec61dd9ca9cd97643ccf5b553c406e96a82621270214c0c81c32da7f8c388090a304d229925ed6e1548dbce3abcf1a259
HEAD_REF master
PATCHES
PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"

View File

@ -1,6 +1,6 @@
{
"name": "cgal",
"version": "6.0",
"version": "6.0.1",
"description": "The Computational Geometry Algorithms Library (CGAL) is a C++ library that aims to provide easy access to efficient and reliable algorithms in computational geometry.",
"homepage": "https://github.com/CGAL/cgal",
"license": "GPL-3.0-or-later AND LGPL-3.0-or-later AND BSL-1.0",

View File

@ -1589,7 +1589,7 @@
"port-version": 6
},
"cgal": {
"baseline": "6.0",
"baseline": "6.0.1",
"port-version": 0
},
"cgicc": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "72f95d74f101763f740375bfecc249c096e9ff58",
"version": "6.0.1",
"port-version": 0
},
{
"git-tree": "f1be286404a2a318493e10e1818b244e2772f2f0",
"version": "6.0",