Skip to content

Revert "utility: Use insert_or_assign in concurrent unordered map"#388

Merged
charles-lunarg merged 1 commit into
mainfrom
revert-387-use_insert_or_assign
Jun 11, 2026
Merged

Revert "utility: Use insert_or_assign in concurrent unordered map"#388
charles-lunarg merged 1 commit into
mainfrom
revert-387-use_insert_or_assign

Conversation

@charles-lunarg

Copy link
Copy Markdown
Collaborator

Reverts #387

Was found to cause build errors in chrome.

void insert_or_assign(const Key &key, Args &&...args) {
uint32_t h = ConcurrentMapHashObject(key);
WriteLockGuard lock(locks[h].lock);
maps[h].insert_or_assign(key, {std::forward<Args>(args)...});

@artem-lunarg artem-lunarg Jun 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this failed because {std::forward(args)...} does not define a type, so adding T before probably (with enough luck) will help. And version with [] - it returns reference to existing/newly inserted element, so the type is known. Btw, original version from Gemini had T (that Spencer provied in internal chat)

@artem-lunarg artem-lunarg left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spencer is AFI. I can approve in case he is not back soon. Then we can decide if we want to fix this.

@charles-lunarg charles-lunarg merged commit e491037 into main Jun 11, 2026
29 checks passed
@charles-lunarg charles-lunarg deleted the revert-387-use_insert_or_assign branch June 11, 2026 19:15
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.

2 participants