• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moonbitlang / core / 3149

23 Mar 2026 09:26AM UTC coverage: 95.721% (-0.02%) from 95.741%
3149

push

github

bobzhang
fix(priority_queue): rewrite copy() iteratively to prevent stack overflow

The recursive copy_node() walked both sibling and child chains via
recursion. In a pairing heap, monotonic insert patterns create linear
sibling chains, so copy() would overflow the stack on large queues
(e.g., 200k elements).

Rewrite to use an explicit work stack, processing child and sibling
links iteratively. Add a regression test with 10k monotonic inserts
to verify copy works on deep structures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

5 of 7 new or added lines in 1 file covered. (71.43%)

1 existing line in 1 file now uncovered.

13826 of 14444 relevant lines covered (95.72%)

175992.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.89
/priority_queue/priority_queue.mbt


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc