diff --git a/cell.cpp b/cell.cpp index 191de2e3..d701a3a6 100644 --- a/cell.cpp +++ b/cell.cpp @@ -99,7 +99,7 @@ struct hrmap_spherical : hrmap { hrmap_spherical() { mvar = variation; for(int i=0; i (S7)); h.s = hsOrigin; h.emeraldval = i; h.zebraval = i; @@ -190,7 +190,7 @@ struct hrmap_spherical : hrmap { ~hrmap_spherical() { dynamicval ph(variation, mvar); for(int i=0; i (S7); // heptagon *oldorigin = origin; allh[0]->alt = base.origin; @@ -1030,7 +1030,7 @@ struct hrmap_quotient : hrmap { ~hrmap_quotient() { for(int i=0; imove(t)->move(c->c.spin(t)) = NULL; } DEBMEM ( printf("DEL %p\n", c); ) - delete c; + tailored_delete(c); } heptagon deletion_marker; @@ -1273,7 +1273,7 @@ void clearfrom(heptagon *at) { at->move(i) = NULL; } clearHexes(at); - delete at; + tailored_delete(at); } //printf("maxq = %d\n", maxq); } diff --git a/hyper.h b/hyper.h index 70785fed..59aba9a2 100644 --- a/hyper.h +++ b/hyper.h @@ -432,6 +432,10 @@ template T* tailored_alloc(int degree) { return result; } +void inline tailored_delete(void *x) { + delete[] ((char*) (x)); + } + static const struct wstep_t { wstep_t() {} } wstep; static const struct wmirror_t { wmirror_t() {}} wmirror; static const struct rev_t { rev_t() {} } rev;