[llvm-dev] RFC: Should SmallVectors be smaller?
Dean Michael Berris via llvm-dev
llvm-dev at lists.llvm.org
Thu Jun 21 19:53:24 PDT 2018
> On 22 Jun 2018, at 12:30, Bekket McClane <bekket.mcclane at gmail.com> wrote:
>
> To Dean,
>
> I think Duncan’s approach prohibit any usage of Small after the capacity grow over SmallCapacity.
> So when the capacity exceed SmallCapacity, one should:
> 1. Allocate memory on heap
> 2. Copy data from Small to that chunk
> 3. Assign pointer of that chunk to Large
>
> As long as you always access Large after growth, there would be no data lose.
>
Ah, yes. That makes sense.
I’m curious to see, like Chris, what the benchmarks say about this alternative approach.
-- Dean
More information about the llvm-dev
mailing list