Skip to content

Remove SoBase auditors by pointer and registration type - #822

Draft
Dikluwe wants to merge 10 commits into
coin3d:masterfrom
Dikluwe:codex/pr/sobase-auditor-type
Draft

Dikluwe wants to merge 10 commits into
coin3d:masterfrom
Dikluwe:codex/pr/sobase-auditor-type

Conversation

@Dikluwe

@Dikluwe Dikluwe commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Problem

SoBase::removeAuditor(auditor, type) currently ignores type. When a pointer has registrations with different types, removal can delete the wrong registration. Tree rotations also mean equal keys can appear on either side, so a pointer/data search must inspect both equal-key subtrees.

Changes

  • Add the C API cc_rbptree_remove_with_data(), removing one matching occurrence without changing the tree when the pair is absent.
  • Use the same total pointer ordering as insertion when searching for the pair.
  • Pass the registration type from SoBase::removeAuditor().
  • Exercise typed removal from SoBase and a real C client, including duplicate pairs, missing pairs, null data and inline/allocated nodes.

Both key and data may be null and remain borrowed. Existing signatures/layout are preserved; the added C symbol is exported. The C client is compiled as C and linked with the C++ driver so the instrumented Coin library can resolve its vptr runtime. The final comment-only commit restores documentation to the public removal function.

Dependencies — keep as draft

Requires the SoBase cache PR #821 and #813. This branch includes both prerequisites, so its current diff against master is cumulative. Rebase after the prerequisites are integrated before marking ready.

Validation

Linux candidate 90/90 CTests, individual integration lab 134/134. The C symbol was linked and checked with nm. A diagnostic implementation that ignored type failed the regression. Nullable C clients passed ASan/UBSan/LeakSanitizer. The final publication integration gate is recorded below; the comment-only refinement preserves executable source tokens.

Final publication gate — 2026-10-08

The exact published heads, merged over the existing integration lab, passed 13/13 directed CTests and 139/139 total CTests, with no skips. GCC/Ninja Debug shared build, COIN_THREADSAFE=ON, external Expat, all build/compiler temporary files in RAM. The GLX test environment used Xvfb, LIBGL_ALWAYS_SOFTWARE=1 and COIN_GLX_PIXMAP_DIRECT_RENDERING=1. The initial full run omitted the latter setting and failed to create GLX contexts; the corrected environment passed without code changes. Integration commit: bc83f34.

Native Windows/macOS and ABI checks are left to this PR's CI.

Typed-removal delta after the cache prerequisite (this comparison also includes #813).

This branch has not been deployed

No deployments
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