3 ms·
I really like APR. While pooled allocation isn’t always the best approach, it makes a lot of sense in server software, and reduces the risk of many classic memo
by maxlybbert 8y ago
I really like APR. While pooled allocation isn’t always the best approach, it makes a lot of sense in server software, and reduces the risk of many classic memory problems (e.g., I don’t have to worry whether I pair 1000 mallocs with 1000 frees; it’s acceptable to pair 1000 apr_pallocs with a single apr_pool_free).
ASAN is certainly helpful when using classic memory management techniques, but since so much C code uses custom memory management of some kind, it has to handle more than malloc and free.
I certainly hope people improve ASAN instead of abandon things like memory pools. I would consider “malloc and free with ASAN” to be a step down from APR’s pools.
- shereadsthenews 8y agoASAN does handle this. As nkurz noted, custom allocators need only poison/unpoison memory regions to benefit from ASAN and MSAN. For example see how the absl "SwissTable" does: https://github.com/abseil/abseil-cpp/blob/master/absl/container/internal/raw_hash_set.h#L1587 https://github.com/abseil/abseil-cpp/blob/master/absl/contai...