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

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 11:41:03 PST 2023


================
@@ -27,15 +27,21 @@ static void reportDeallocation(void *ptr) {
     if (__scudo_deallocate_hook)
       __scudo_deallocate_hook(ptr);
 }
-static void reportReallocBegin(void *old_ptr) {
-  if (SCUDO_ENABLE_HOOKS)
-    if (__scudo_realloc_begin_hook)
-      __scudo_realloc_begin_hook(old_ptr);
+static void reportReallocAllocation(void *old_ptr, void *new_ptr, size_t size) {
+  if (SCUDO_ENABLE_HOOKS) {
+    if (__scudo_realloc_allocate_hook)
+      __scudo_realloc_allocate_hook(old_ptr, new_ptr, size);
+    else
----------------
ChiaHungDuan wrote:

BTW, added a DCHECK for the new_ptr != nullptr

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


More information about the llvm-commits mailing list