Commit 6f79a2d
committed
fix: implement deallocation for fixed-length lists with heap elements
The deallocate and deallocate_indirect functions in the core ABI had
incomplete handling for FixedLengthList types. deallocate had a todo!()
that would panic when flat deallocation was needed for fixed-length
lists containing resources. deallocate_indirect was a silent no-op
that would leak memory for fixed-length lists containing heap-allocated
elements like strings or nested lists.
For flat deallocation, reuse flat_for_each_record_type with repeated
element types. For indirect deallocation, reuse deallocate_indirect_fields
with a vec of repeated element types to correctly compute memory offsets
and deallocate each element.1 parent fd57889 commit 6f79a2d
File tree
3 files changed
+138
-2
lines changed- .idea
- crates
- core/src
- rust/tests
3 files changed
+138
-2
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2404 | 2404 | | |
2405 | 2405 | | |
2406 | 2406 | | |
2407 | | - | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
2408 | 2414 | | |
2409 | 2415 | | |
2410 | 2416 | | |
| |||
2526 | 2532 | | |
2527 | 2533 | | |
2528 | 2534 | | |
2529 | | - | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
2530 | 2539 | | |
2531 | 2540 | | |
2532 | 2541 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
145 | 183 | | |
146 | 184 | | |
147 | 185 | | |
| |||
0 commit comments