Commit ab24986
gc.c: remove all matching entries in mrb_gc_unregister()
Previously only the first match was removed, leaking duplicate
entries when the same object was registered multiple times.
Use two-pointer compaction for O(N) removal.
Fixes mruby#6760.
Co-authored-by: Claude <noreply@anthropic.com>1 parent c2b5881 commit ab24986
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
545 | 545 | | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
551 | 550 | | |
552 | 551 | | |
| 552 | + | |
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
| |||
0 commit comments