Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve precision for boxes #71

Open
momvart opened this issue Apr 20, 2023 · 0 comments
Open

Improve precision for boxes #71

momvart opened this issue Apr 20, 2023 · 0 comments

Comments

@momvart
Copy link

momvart commented Apr 20, 2023

Boxes provide the simplest form of heap allocation in Rust. However, because they own a pointer, flowistry conservatively considers a maximum (unknown) region for them causing all of them to be grouped under a single alias group.
This behavior seems to be an exception, which can be rooted here.

_ if ty.is_box() => {
self.visit_region(tcx.mk_region_from_kind(RegionKind::ReVar(UNKNOWN_REGION)));

As Boxes are probably the most-used structure for heap allocation, improving the precision of the analysis for them and avoiding reasoning about the pointer inside them can help a lot. It also affects the results for other types such as vectors when they use boxes. (e.g., using into_boxed_slice or some forms of vec! macro).

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

No branches or pull requests

1 participant