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

Christopher Ferris via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 18:15:23 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) {
----------------
cferris1000 wrote:

I think it make more sense to leave the !ptr and size == 0 checks here before calling the callback functions. Even though the original user did call realloc in these cases, the actual operations are not reallocs, so I think it make sense to skip the reportRealloc hooks in that case.

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


More information about the llvm-commits mailing list