Commit 747fbc2
authored
tp: make FlexVector::shrink_to_fit a no-op at minimal capacity (#7198)
shrink_to_fit unconditionally reallocated and copied the storage even
when capacity was already the smallest legal size for the current
element count. Dataframe::Finalize calls it on every column of every
built dataframe, so each finalize silently copied all column storage.
That copy also defeats any downstream design that wants to share or
move finalized column storage instead of duplicating it.
Return early when the aligned size already equals capacity, making the
call free in the common already-minimal case.1 parent 386d870 commit 747fbc2
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
| |||
0 commit comments