[libcxx-commits] [libcxx] [ASan][libc++] Optimize `__annotate_delete` for the default allocator (PR #76176)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jan 10 13:51:30 PST 2024
AdvenamTacet wrote:
I see your point, but I'm not sure an interface is feasible option.
We would end up adding a lot of code in another place, but removing very little of code here. `basic_string` and `vector` have very similar implementations of annotations, but inside `basic_string` we have to additionally take care of a null terminator (not included in `size()` or `capacity()`). Therefore, the only function we can unify in the interface is `__annotate_contiguous_container` (but then `__beg` and `__end` have to be arguments to it) and possibly we can move some checks (like the one included in this PR). But the rest has to be handled separately. `deque` is so different, that we need a separate interface.
Possibly we can just move those functions to another class/file (but keep separate implementations for every class).
We would have to do it in a way that optimizations are not affected in any way to keep current performance.
I don't see a way to do it, without increasing complexity.
I don't really like an idea of an interface for ASan annotations.
@EricWF @ldionne what do you think?
https://github.com/llvm/llvm-project/pull/76176
More information about the libcxx-commits
mailing list