[clang] [NFC][analyzer][docs] Document MallocChecker's ownership attributes (PR #121759)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 6 09:10:23 PST 2025


=?utf-8?q?Kristóf?= Umann <dkszelethus at gmail.com>,
=?utf-8?q?Kristóf?= Umann <dkszelethus at gmail.com>,
=?utf-8?q?Kristóf?= Umann <dkszelethus at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/121759 at github.com>


================
@@ -1407,8 +1407,17 @@ These attributes are used by the Clang Static Analyzer's dynamic memory modeling
 facilities to mark custom allocating/deallocating functions.
 
 All 3 attributes' first parameter of type string is the type of the allocation:
-``malloc``, ``new``, etc. to allow for catching mismatched deallocation bugs to
-be found.
+``malloc``, ``new``, etc. to allow for catching :ref:`mismatched deallocation
+<unix-MismatchedDeallocator>` bugs to
+be found. The allocation type can be any string, e.g. a function annotated with
+returning a piece of memory of type ``lasagna`` but freed with a function
+annoteted to release ``cheese`` typed memory will result in mismatched
----------------
steakhal wrote:

```suggestion
annotated to release ``cheese`` typed memory will result in mismatched
```

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


More information about the cfe-commits mailing list