[clang] Introduce paged vector (PR #66430)

Giulio Eulisse via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 15 04:58:43 PDT 2023


ktf wrote:

@s-barannikov, AFAICT, that would not work because the overwrite is not unconditional, but it will actually check for default initialised content. Basically the current mechanics relies on default initialisation rather than being "uninitialised". This for sure does not work with LoadedDecls (I just checked). 

I even thought to have a `std::pmr::vector` backed by `calloc`, so that uninitialised parts are guaranteed to be zero-ed. However in the end I considered such implementation more complicated and I went for what I have in this PR (especially because I am not sure `std::pmr*` are actually allowed in the codebase).

Besides the above considerations, at least for my use case, I also noticed the page granularity is actually not good enough to guarantee good memory savings (that's why I use 1024 / sizeof(T)).

https://github.com/llvm/llvm-project/pull/66430


More information about the cfe-commits mailing list