[compiler-rt] hwasan: refactor interceptor allocation/deallocation functions (PR #145357)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 22 15:50:34 PDT 2025


================
@@ -31,13 +31,20 @@
 
 namespace __hwasan {
 
+enum AllocType {
+  FROM_MALLOC = 1,  // Memory block came from malloc, calloc, realloc, etc.
+  FROM_NEW = 2,     // Memory block came from operator new.
+  FROM_NEW_BR = 3   // Memory block came from operator new [ ]
+};
+
 struct Metadata {
  private:
   atomic_uint64_t alloc_context_id;
   u32 requested_size_low;
   u16 requested_size_high;
   atomic_uint8_t chunk_state;
-  u8 lsan_tag;
+  u8 lsan_tag : 2;
----------------
vitalybuka wrote:

This is new stuff, should be out of "refactor" patches

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


More information about the llvm-commits mailing list