Skip to content

<xmemory>: Document the mechanisms and invariants for container proxy objects - #6500

Open
A. Jiang (frederick-vs-ja) wants to merge 10 commits into
microsoft:mainfrom
frederick-vs-ja:document-container-proxy-objects
Open

A. Jiang (frederick-vs-ja) wants to merge 10 commits into
microsoft:mainfrom
frederick-vs-ja:document-container-proxy-objects

Conversation

@frederick-vs-ja

Copy link
Copy Markdown
Contributor

Fixes #2084.

The initial version of the comments largely contained my personal explanations and opinions, especially for those starting with TRANSITION, ABI. Refinements from actual maintainers of MSVC STL are probably necessary.

The initial version of the comments largely contained my personal
explanations and opinions, especially for those starting with
`TRANSITION, ABI`. Refinements from actual maintainers of MSVC STL are
probably necessary.
@frederick-vs-ja
A. Jiang (frederick-vs-ja) requested a review from a team as a code owner October 26, 2026 11:46
Copilot AI balanced review requested due to automatic review settings October 26, 2026 11:46
@github-project-automation github-project-automation Bot moved this to Initial Review in STL Code Reviews Oct 26, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Incorrect descriptions of proxy relationships and iterator-validity invariants undermine the documentation’s core purpose.

7 open issues
What changed in this PR

Documents the container-proxy and iterator-debugging machinery in <xmemory>, addressing the missing explanations identified in #2084.

Changes:

  • Adds comments describing proxy relationships, iterator lists, allocation, and locking.
  • Documents debug-level differences and proposed future ABI changes.
  • Consolidates _Adopt’s conditional compilation into one function without changing its logic.
File Description
stl/​inc/​xmemory Expands iterator-debugging documentation and reorganizes _Adopt’s conditional compilation.

Review effort: Balanced

Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Copilot AI balanced review requested due to automatic review settings October 26, 2026 12:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new documentation misstates iterator-validity guarantees and proxy relationships, undermining its purpose as a maintenance reference.

2 open issues
2 previously missed issues

In code that hasn't changed since last review

Low severity Describe proxy association and orphaned state

stl/​inc/​xmemory:1429

This member points to the container's proxy, not directly to the container; _Getcont() follows _Myproxy->_Mycont. Invalidation does not necessarily clear this member, so describe the proxy association and use “orphaned” for the null state.

Low severity Correct assignment behavior and invalidation spelling

stl/​inc/​xmemory:1441

Assignment delegates to _Adopt_unlocked, which prepends rather than appends and leaves the list unchanged when parentage is unchanged. Please describe that behavior and correct invalidats; the same correction is needed for _Assign_locked at stl/inc/xmemory:1455–1456.

7 resolved since last review

Review effort: Balanced

Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Copilot AI balanced review requested due to automatic review settings October 29, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved documentation inaccuracies in stl/inc/xmemory misstate proxy binding and indirection, iterator insertion order, and _Getcont() availability across debug levels.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory

#if _ITERATOR_DEBUG_LEVEL == 0
// fake "allocator rebinding" helper, avoiding branches among different `_ITERATOR_DEBUG_LEVEL`s
// TRANSITION, ABI: This will be eliminated together with dynamic allocation of proxy objects.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is TRANSITION due to deque.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should also eliminate dynamically allocated proxy objects for deque, even though the (seemingly abandoned) existing vNext branch didn't seem to have this done.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See also #147.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 02:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed to evaluate subtle documentation inaccuracies involving proxy indirection, unbound proxy state, and conditional iterator-list updates.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Comment thread stl/inc/xmemory Resolved
Copilot AI balanced review requested due to automatic review settings November 18, 2026 17:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved documentation issues misdescribe proxy indirection, initial binding state, and list-assignment behavior, while leaving allocator-matching requirements unclear.

2 open issues

Review effort: Balanced

Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Copilot AI balanced review requested due to automatic review settings November 19, 2026 07:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The documentation still misidentifies _Myproxy as pointing directly to the container and incorrectly describes an unbound proxy as already associated with a container.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 24, 2026 02:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Comments in stl/inc/xmemory misdescribe the proxy’s initially unbound state and container indirection, and contain unresolved spelling and grammar errors.

10 open issues

Review effort: Balanced

Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Comment thread stl/inc/xmemory Resolved
Copilot AI balanced review requested due to automatic review settings November 24, 2026 03:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

documentation Related to documentation or comments

Projects

Status: Maintainer Review

Development

Successfully merging this pull request may close these issues.

<xmemory>: Document the iterator debugging invariants

5 participants