[cfe-dev] Possible trivial correction to test/Analysis/malloc-annotations.c

Anna Zaks ganna at apple.com
Thu Apr 18 11:21:17 PDT 2013

>From the name of the function, 'ownership_takes' does seem to be the better match. 

Note, that the checker that uses the annotation (MallocOptimistic) is in alpha state and probably needs a major redesign and productization. The functionality that is there now has not been tested much. Currently, that checker assumes that every function which might free memory will be annotated. This applies to functions that free memory indirectly, by calling another function. This greatly limits applicability of the checker. 

We are thinking of augmenting the MallocPessimistic, which assumes that any unknown function can free memory, with annotations on functions which the user has more info about, instead of reviving the MallocOptimistic checker.


On Apr 18, 2013, at 10:02 AM, Bruce Stephens <bruce.r.stephens at gmail.com> wrote:

> Shouldn't myfreeBoth be annotated with
> __attribute((ownership_takes(malloc, 1, 2))) rather than
> ownership_holds?
> (Makes no practical difference, but logically it makes sense?)
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130418/cc524713/attachment.html>

More information about the cfe-dev mailing list