Skip to content

smart_ptr: always-on tracking with linked list, remove debug macros#2420

Merged
borisbat merged 1 commit intomasterfrom
ptr-ref-count-goo
Apr 14, 2026
Merged

smart_ptr: always-on tracking with linked list, remove debug macros#2420
borisbat merged 1 commit intomasterfrom
ptr-ref-count-goo

Conversation

@borisbat
Copy link
Copy Markdown
Collaborator

Summary

  • Remove DAS_SMART_PTR_DEBUG, DAS_SMART_PTR_TRACKER, DAS_SMART_PTR_MAGIC, DAS_SMART_PTR_ID, and DAS_ENABLE_SMART_PTR_TRACKING conditional compilation — all debug infrastructure is now always-on
  • Replace ref_count_ids (das_set<uint64_t>) with intrusive doubly-linked list of all live ptr_ref_count objects
  • Add ref_count_magic field for type identification (Context/Program/FileAccess) without dynamic_cast
  • Add DumpTrackPtr() that walks the linked list at shutdown to report leaked pointers with type info
  • Remove safeDumpType, dumpTrackingLeaks, sptrAllocations (dead tracking system)
  • Doc fixes: smart_ptr<DataWalker>DataWalker?
  • Remove dead smart_ptr<ast::*> branches from apply_to_vec

Test plan

  • 6040 tests passed (dastest -- --test tests)
  • 5455 AOT tests passed (test_aot -use-aot)
  • No .das files changed — lint/format N/A

🤖 Generated with Claude Code

Remove DAS_SMART_PTR_DEBUG, DAS_SMART_PTR_TRACKER, DAS_SMART_PTR_MAGIC,
DAS_SMART_PTR_ID, and DAS_ENABLE_SMART_PTR_TRACKING conditional compilation.
All debug infrastructure is now always-on.

Replace ref_count_ids (das_set) with intrusive doubly-linked list of all
live ptr_ref_count objects. Add ref_count_magic field for type identification
(Context/Program/FileAccess) without dynamic_cast. Add DumpTrackPtr() that
walks the list at shutdown to report leaked pointers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@borisbat borisbat merged commit 4a1a0ce into master Apr 14, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant