Commit 0d26662
authored
Rollup merge of rust-lang#133861 - shamb0:refactor_InterpCx_allocate_str, r=RalfJung
Add allocate_bytes and refactor allocate_str in InterpCx for raw byte…
Fixes rust-lang/miri#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: rust-lang/miri#40691 file changed
+32
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
1024 | 1025 | | |
1025 | | - | |
| 1026 | + | |
| 1027 | + | |
1026 | 1028 | | |
1027 | 1029 | | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
| 1030 | + | |
1031 | 1031 | | |
1032 | | - | |
| 1032 | + | |
1033 | 1033 | | |
1034 | 1034 | | |
1035 | | - | |
| 1035 | + | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | | - | |
| 1038 | + | |
1039 | 1039 | | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
1043 | 1060 | | |
| 1061 | + | |
| 1062 | + | |
1044 | 1063 | | |
1045 | 1064 | | |
1046 | 1065 | | |
| |||
0 commit comments