Skip to content

Keep registered immutable objects alive to prevent object ID reuse. - #620

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_988516487
Sep 26, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_988516487

Conversation

@copybara-service

Copy link
Copy Markdown

Keep registered immutable objects alive to prevent object ID reuse.

Store id(value) -> value in _IMMUTABLE_OBJECT_IDS and _FUNCTIONS_WITH_IMMUTABLE_RETURN_VALUES instead of storing only id(value) in sets, so registered objects are not garbage collected and their memory addresses cannot be reused by newly allocated objects.

@copybara-service
copybara-service Bot force-pushed the test_988516487 branch 2 times, most recently from 7d3148f to e42dc81 Compare September 26, 2026 08:20
Store `id(value) -> value` in `_IMMUTABLE_OBJECT_IDS` and `_FUNCTIONS_WITH_IMMUTABLE_RETURN_VALUES` instead of storing only `id(value)` in sets, so registered objects are not garbage collected and their memory addresses cannot be reused by newly allocated objects.

PiperOrigin-RevId: 988745384
@copybara-service
copybara-service Bot merged commit 5823b29 into main Sep 26, 2026
7 checks passed
@copybara-service
copybara-service Bot deleted the test_988516487 branch September 26, 2026 08:25
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