mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-08 13:20:06 +00:00
MSVC: Workaround crtdbg macroing free().
This commit is contained in:
parent
9462b90067
commit
96d95fbb31
@ -1377,7 +1377,7 @@ public:
|
||||
~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 @@ public:
|
||||
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 @@ public:
|
||||
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 @@ public:
|
||||
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 @@ public:
|
||||
void reset()
|
||||
{
|
||||
if (holder)
|
||||
group->pools[type]->free_opaque(holder);
|
||||
group->pools[type]->deallocate_opaque(holder);
|
||||
holder = nullptr;
|
||||
type = TypeNone;
|
||||
}
|
||||
|
@ -546,7 +546,7 @@ class ObjectPoolBase
|
||||
{
|
||||
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 @@ public:
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user