rust/compiler/rustc_const_eval
Matthias Krüger 0d26662fd3
Rollup merge of #133861 - shamb0:refactor_InterpCx_allocate_str, r=RalfJung
Add allocate_bytes and refactor allocate_str in InterpCx for raw byte…

Fixes https://github.com/rust-lang/miri/issues/4025

This PR introduces a new `allocate_bytes` function in InterpCx and refactors `allocate_str` to use it internally. This change improves memory allocation handling in the interpreter by:

1. Adding `allocate_bytes`:
   - Direct byte slice allocation support
   - Handles both mutable and immutable allocations
   - Maintains proper memory alignment and deduplication

2. Refactoring `allocate_str`:
   - Now uses `allocate_bytes` internally
   - Adds string-specific metadata handling
   - Preserves existing string allocation behavior

This is part 1 of the planned changes to improve timezone string handling in Miri. A follow-up PR will update Miri's timezone logic to use this new allocation mechanism.

Related: https://github.com/rust-lang/miri/pull/4069
2024-12-08 14:28:24 +01:00
..
src Rollup merge of #133861 - shamb0:refactor_InterpCx_allocate_str, r=RalfJung 2024-12-08 14:28:24 +01:00
Cargo.toml compiler: Factor rustc_target::abi out of const_eval 2024-10-08 18:24:56 -07:00
messages.ftl Get rid of HIR const checker 2024-11-22 02:32:26 +00:00