[llvm-dev] [LLVM] Sparse set

Michael Ilseman via llvm-dev llvm-dev at lists.llvm.org
Mon May 8 18:13:30 PDT 2017


> On May 4, 2017, at 9:14 AM, Simone Atzeni via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hi,
> 
> are the elements in a SparseSet stored in a contiguous memory region?

Yes, the point of the data structure is to have a sparse array for keys and a dense vector for storage.

> Looking at the implementation, seems that each element is pushed back into a SmallVector.
> If so, is it possible to retrieve that data as a chunk?
> For example, if I have a std::vector underneath I would use v.data().
> 

SparseSet exposes begin()/end() on the underlying dense vector. If you have a compelling use case, you could also add an API to return a reference to the dense vector.

> Thanks.
> Simone
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list