Skip to content

Conversation

@jacob-hughes
Copy link
Collaborator

Currently, there is an unstable API for allocating RC objects with allocators other than the GlobalAllocator. For Alloy this is unsound, as it allows for pointers to GC objects to be missed.

This commit provides an error lint which prevents this API from being used. It is enabled by default, but users can disable it with the #[allow(untracked_heap_allocation)] attribute.

@jacob-hughes
Copy link
Collaborator Author

I noticed this as an issue while fixing allocation tracking of non-GC objects. Luckily, it seems that the benchmarks that we run do not use this feature, but we should definitely disable it by default.

@ltratt ltratt added this pull request to the merge queue Jun 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 17, 2025
Currently, there is an unstable API for allocating RC objects with
allocators other than the GlobalAllocator. For Alloy this is unsound, as
it allows for pointers to GC objects to be missed.

This commit provides an error lint which prevents this API from being
used. It is enabled by default, but users can disable it with the
`#[allow(untracked_heap_allocation)]` attribute.
@jacob-hughes jacob-hughes force-pushed the untracked-allocation-lint branch from 6efab5a to 3410301 Compare June 17, 2025 22:03
@jacob-hughes
Copy link
Collaborator Author

The tidy checker requires a working doc test for this lint, so I've force-pushed a fix which adds one.

@ltratt ltratt added this pull request to the merge queue Jun 18, 2025
Merged via the queue into softdevteam:master with commit ed2408f Jun 18, 2025
2 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.

2 participants