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

String de-duplication for localtime_r #4025

Open
tiif opened this issue Nov 10, 2024 · 1 comment
Open

String de-duplication for localtime_r #4025

tiif opened this issue Nov 10, 2024 · 1 comment
Labels
A-interpreter Area: affects the core interpreter C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available

Comments

@tiif
Copy link
Contributor

tiif commented Nov 10, 2024

Since this is already brought up in #3470 (comment), I will just open a new issue for this.

To resolve the FIXME here,

miri/src/shims/time.rs

Lines 198 to 199 in 052bdcb

// FIXME: String de-duplication is needed so that we only allocate this string only once
// even when there are multiple calls to this function.

we could do:

We should have allocate_bytes which allocates a byte slice, and that should use the cache. allocate_str can call that, and transmute the result to &str.

@tiif
Copy link
Contributor Author

tiif commented Nov 10, 2024

@rustbot label +C-enhancement

@rustbot rustbot added the C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement label Nov 10, 2024
@RalfJung RalfJung added A-interpreter Area: affects the core interpreter E-good-first-issue A good way to start contributing, mentoring is available labels Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interpreter Area: affects the core interpreter C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available
Projects
None yet
Development

No branches or pull requests

3 participants