MSVC: Workaround crtdbg macroing free().
diff --git a/spirv_common.hpp b/spirv_common.hpp
index 4bafbf9..95f7566 100644
--- a/spirv_common.hpp
+++ b/spirv_common.hpp
@@ -1377,7 +1377,7 @@
~Variant()
{
if (holder)
- group->pools[type]->free_opaque(holder);
+ group->pools[type]->deallocate_opaque(holder);
}
// Marking custom move constructor as noexcept is important.
@@ -1396,7 +1396,7 @@
if (this != &other)
{
if (holder)
- group->pools[type]->free_opaque(holder);
+ group->pools[type]->deallocate_opaque(holder);
holder = other.holder;
group = other.group;
type = other.type;
@@ -1420,7 +1420,7 @@
if (this != &other)
{
if (holder)
- group->pools[type]->free_opaque(holder);
+ group->pools[type]->deallocate_opaque(holder);
if (other.holder)
holder = other.holder->clone(group->pools[other.type].get());
@@ -1436,13 +1436,13 @@
void set(IVariant *val, Types new_type)
{
if (holder)
- group->pools[type]->free_opaque(holder);
+ group->pools[type]->deallocate_opaque(holder);
holder = nullptr;
if (!allow_type_rewrite && type != TypeNone && type != new_type)
{
if (val)
- group->pools[new_type]->free_opaque(val);
+ group->pools[new_type]->deallocate_opaque(val);
SPIRV_CROSS_THROW("Overwriting a variant with new type.");
}
@@ -1497,7 +1497,7 @@
void reset()
{
if (holder)
- group->pools[type]->free_opaque(holder);
+ group->pools[type]->deallocate_opaque(holder);
holder = nullptr;
type = TypeNone;
}
diff --git a/spirv_cross_containers.hpp b/spirv_cross_containers.hpp
index f2179b4..a027250 100644
--- a/spirv_cross_containers.hpp
+++ b/spirv_cross_containers.hpp
@@ -546,7 +546,7 @@
{
public:
virtual ~ObjectPoolBase() = default;
- virtual void free_opaque(void *ptr) = 0;
+ virtual void deallocate_opaque(void *ptr) = 0;
};
template <typename T>
@@ -580,15 +580,15 @@
return ptr;
}
- void free(T *ptr)
+ void deallocate(T *ptr)
{
ptr->~T();
vacants.push_back(ptr);
}
- void free_opaque(void *ptr) override
+ void deallocate_opaque(void *ptr) override
{
- free(static_cast<T *>(ptr));
+ deallocate(static_cast<T *>(ptr));
}
void clear()