[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:21 PST 2023


================
@@ -17,10 +17,15 @@ extern "C" {
 __attribute__((weak)) const char *__scudo_default_options(void);
 
 // Post-allocation & pre-deallocation hooks.
-// They must be thread-safe and not use heap related functions.
 __attribute__((weak)) void __scudo_allocate_hook(void *ptr, size_t size);
 __attribute__((weak)) void __scudo_deallocate_hook(void *ptr);
 
+// These hooks are used to mark the scope of doing realloc(). Note that the
+// allocation/deallocation are still reported through the hooks above, this is
+// only used when you want to group two operations in the realloc().
----------------
cferris1000 wrote:

Would it be better to describe this as:

only used when a hook user wants to know that the deallocate/allocate operation are a single realloc operation.

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


More information about the llvm-commits mailing list