|
|
@ -423,12 +423,15 @@ namespace df
|
|
|
|
using DFHack::BitArray;
|
|
|
|
using DFHack::BitArray;
|
|
|
|
using DFHack::DfArray;
|
|
|
|
using DFHack::DfArray;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
|
|
|
|
template<class T>
|
|
|
|
template<class T>
|
|
|
|
void *allocator_fn(void *out, const void *in) {
|
|
|
|
void *allocator_fn(void *out, const void *in) {
|
|
|
|
if (out) { *(T*)out = *(const T*)in; return out; }
|
|
|
|
if (out) { *(T*)out = *(const T*)in; return out; }
|
|
|
|
else if (in) { delete (T*)in; return (T*)in; }
|
|
|
|
else if (in) { delete (T*)in; return (T*)in; }
|
|
|
|
else return new T();
|
|
|
|
else return new T();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
template<class T>
|
|
|
|
void *allocator_nodel_fn(void *out, const void *in) {
|
|
|
|
void *allocator_nodel_fn(void *out, const void *in) {
|
|
|
|