We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4501c41 commit 25c6962Copy full SHA for 25c6962
core/vdbe/sorter.rs
@@ -408,6 +408,18 @@ impl Sorter {
408
}
409
410
411
+impl Drop for Sorter {
412
+ fn drop(&mut self) {
413
+ // Drop all arena-allocated records to free their inner heap allocations
414
+ // (Vec, ImmutableRecord payload, etc.) before the arena memory is released.
415
+ // Bumpalo doesn't run destructors, so we must do this manually.
416
+ for ptr in self.records.drain(..) {
417
+ // SAFETY: All pointers are valid (arena not yet dropped).
418
+ unsafe { std::ptr::drop_in_place(ptr.as_ptr()) };
419
+ }
420
421
+}
422
+
423
#[derive(Debug, Clone, Copy)]
424
enum NextState {
425
Start,
0 commit comments