[compiler-rt] [scudo] Add hooks to mark the range of realloc (PR #73883)

Fabio D'Urso via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 11:54:34 PST 2023


================
@@ -163,23 +208,11 @@ INTERFACE WEAK void *SCUDO_PREFIX(pvalloc)(size_t size) {
 }
 
 INTERFACE WEAK void *SCUDO_PREFIX(realloc)(void *ptr, size_t size) {
-  if (!ptr) {
----------------
fabio-d wrote:

No strong opinion either, but I'd lean on the side of handling them separately. It would make it easier to describe the contract of the new hooks (always `__scudo_realloc_begin_hook` followed by `__scudo_deallocate_hook` followed by `__scudo_allocate_hook` followed by `__scudo_realloc_end_hook`) and client code wouldn't have to second-guess what the intent of the realloc call was.

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


More information about the llvm-commits mailing list