[compiler-rt] [scudo] Add hooks to mark the range of realloc (PR #74353)
Christopher Ferris via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 7 12:37:43 PST 2023
================
@@ -20,6 +20,20 @@ __attribute__((weak)) const char *__scudo_default_options(void);
__attribute__((weak)) void __scudo_allocate_hook(void *ptr, size_t size);
__attribute__((weak)) void __scudo_deallocate_hook(void *ptr);
+// `realloc` involves both deallocation and allocation but they are not reported
+// atomically. In one specific case which may keep taking a snapshot right in
+// the middle of `realloc` reporting the deallocation and allocation, it may
+// confuse the user by the missing memory from `realloc`. To alleviate that
+// case, define the two `realloc` hooks to get the knowledge of the bundled hook
+// calls. This hooks are optional and only used when you are pretty likely to
----------------
cferris1000 wrote:
This -> These
and only used when you are pretty likely to -> and should only be used when a hooks user wants to track reallocs more closely.
or something similar.
https://github.com/llvm/llvm-project/pull/74353
More information about the llvm-commits
mailing list