From 58a2859146b41ad5604d58cdac63caff5806f92b Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 19 Sep 2026 19:34:48 +0200 Subject: [PATCH] improved debug output of the clear memory debugger --- cell.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cell.cpp b/cell.cpp index 38ad590d..dd4d4302 100644 --- a/cell.cpp +++ b/cell.cpp @@ -647,21 +647,21 @@ EX debugflag debug_memory_cell = {"memory_cell"}; EX void clearcell(cell *c) { if(!c) return; - indenter_finish iclearcell(debug_memory_cell, hr::format("memory_cell %d %p\n", c->type, hr::voidp(c))); + indenter_finish iclearcell(debug_memory_cell, hr::format("memory_cell %d %p", c->type, hr::voidp(c))); for(int t=0; ttype; t++) if(c->move(t)) { if(debug_memory_cell) println(hlog, hr::format("mov %p [%p] S%d\n", hr::voidp(c->move(t)), hr::voidp(c->move(t)->move(c->c.spin(t))), c->c.spin(t))); if(c->move(t)->move(c->c.spin(t)) != NULL && c->move(t)->move(c->c.spin(t)) != c) { if(debug_errors || debug_memory_cell) - println(hlog, hr::format("cell error: type = %d %d -> %d\n", c->type, t, c->c.spin(t))); + println(hlog, hr::format("cell error: type = %d %d -> %d", c->type, t, c->c.spin(t))); if(worst_precision_error < 1e-3) throw hr_exception("clearcell"); } c->move(t)->move(c->c.spin(t)) = NULL; } if(debug_memory_cell) - println(hlog, hr::format("DEL %p\n", hr::voidp(c))); + println(hlog, hr::format("DEL %p", hr::voidp(c))); gp::delete_mapped(c); destroy_cell(c); } @@ -705,16 +705,18 @@ EX void clear_heptagon(heptagon *at) { EX void clearfrom(heptagon *at) { if(!at) return; + indenter_finish iclearfrom(debug_memory_cell, "clearfrom"); queue q; unlink_cdata(at); q.push(at); at->alt = &deletion_marker; + //int maxq = 0; while(!q.empty()) { at = q.front(); // if(q.size() > maxq) maxq = q.size(); q.pop(); - if(debug_memory_cell) println(hlog, "from %p", at); + if(debug_memory_cell) println(hlog, "from ", at, " c7=", at->c7, " alt=", at->alt); if(!at->c7 && !ls::voronoi_structure()) { heptagon *h = dynamic_cast ((cdata_or_heptagon*) at->cdata); if(h) {