[compiler-rt] [msan] Dynamically grow kNumStackOriginDescrs (PR #92826)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 17:02:39 PDT 2024


thurstond wrote:

> This is not thread safe. I do not think you can do realloc() if you want the mutation to be lock free.

Thanks for the review, I had overlooked thread safety.

> We could simply increase the constant size of the buffer (not perfect, but it is just .bss, not real memory).

This is implemented in https://github.com/llvm/llvm-project/pull/92838

> We could go with an array of pointers to exponentially increasing allocations (i.e. same as your case, but never deallocate, instead just allocate more and consider the container a logical concatenation of multiple buffers).

This is still tricky to implement in a thread-safe, lock-free manner, because there are two arrays to be grown (StackOriginDescrs, StackOriginPC).

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


More information about the llvm-commits mailing list