<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/76861>76861</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Clang SA]: custom malloc/free checker
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mat-c
      </td>
    </tr>
</table>

<pre>
    Hi,

today unix.malloc can be customized with attribute with
__attribute((ownership_returns(malloc, size_pos))
__attribute((ownership_takes(malloc, free_ptr_pos)))

But in some system there can be several allocator. I could be usefull to check that malloc_1 are free with free_1, malloc_2, free with free_2.

Also how do you model custom realloc ?
 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEksFunDAQhp_GXEZBZsxu4MBhkwi15z4AMvbs4sbglT1Ounn6Csi26akSGgQz8_mf36NTcpeFqBOHJ3F4KXTmKcRu1vxgijHYW_fNCXwW8kXI0x45WH2DvLhf5ay9DwaMXmAkMDlxmN0HWXh3PIFmjm7MTNvn3jwMf_4KbAQ24X2hmCZ3HSJxjksS2OxYgc-Q3AcN15AEtuvzPwTrV_oXcI5Ew5XjF8ids8enzOAWSGEmSLfENANPFOk-VKI3itrDRtQcYgnfwYTs7ZrNic7Ze-AAZiLzCjxphv34oQIdaVOw-7FpqVZVnwV4V_glj-VXdSefAkzhHWyAW8gwB0v-02iItNsvVL9XQ2E7ZVvV6oK66lHWqqrVIxZTp-qmkSNhi6QOdBhxlEdr6_aoSKJtZOE6lFjLSiqUqlVVac250ohWkabqaM6iljRr50vv3-YyxEvhUsrUPR6bY1V4PZJP2xIhGq-Xi0Bc9yl2a_3DmC9J1NK7xOkvgR37bfOe1w74cRKHF6FO9_nut9hvFm3-Uixy9N3EfE1CnQT2AvuL4ymPpQmzwH6Ff74erjH8JMMC-01rEthvcn8HAAD__2pZ9YE">