Static Analysis for leaks with dispatch_objects
Hi, I was wondering if there were any plans on adding something to the equivalent of the annotations __attribute__((cf_returns_retained)) to GDC function calls for dispatch objects. Since they're not CFTypes I realize support to clang's static analyzer need to be added. After using a lot of the new dispatch_io calls and having manage dispatch_data_t objects, it seems like there is a much larger use case for analysis support. Thanks, Mike -- Michael Lewis lolrus.org mikelikespie@gmail.com
Hi Mike, we are definitely very aware of this need, but I can't comment on future plans to address it. Please feel free to file a bug on bugreporter.apple.com asking for analyzer support for dispatch objects. Daniel On Oct 25, 2011, at 10:24, Mike Lewis wrote:
Hi,
I was wondering if there were any plans on adding something to the equivalent of the annotations __attribute__((cf_returns_retained)) to GDC function calls for dispatch objects. Since they're not CFTypes I realize support to clang's static analyzer need to be added. After using a lot of the new dispatch_io calls and having manage dispatch_data_t objects, it seems like there is a much larger use case for analysis support.
Thanks, Mike
-- Michael Lewis lolrus.org mikelikespie@gmail.com _______________________________________________ libdispatch-dev mailing list libdispatch-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/libdispatch-dev
Thanks. I will surely file a bug. In the meantime I think I'll just resort to making a C++ wrapper for dispatch objects that will do reference counting for me similar to shared_ptr or something similar to WebKit's RetainPtr [1]. Thanks, Mike [1] http://www.opensource.apple.com/source/JavaScriptCore/JavaScriptCore-461/wtf... -- Michael Lewis lolrus.org mikelikespie@gmail.com On Tue, Oct 25, 2011 at 2:17 PM, Daniel A. Steffen <dsteffen@apple.com>wrote:
Hi Mike,
we are definitely very aware of this need, but I can't comment on future plans to address it.
Please feel free to file a bug on bugreporter.apple.com asking for analyzer support for dispatch objects.
Daniel
On Oct 25, 2011, at 10:24, Mike Lewis wrote:
Hi,
I was wondering if there were any plans on adding something to the equivalent of the annotations __attribute__((cf_returns_retained)) to GDC function calls for dispatch objects. Since they're not CFTypes I realize support to clang's static analyzer need to be added. After using a lot of the new dispatch_io calls and having manage dispatch_data_t objects, it seems like there is a much larger use case for analysis support.
Thanks, Mike
-- Michael Lewis lolrus.org mikelikespie@gmail.com _______________________________________________ libdispatch-dev mailing list libdispatch-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/libdispatch-dev
You may also want to launch the idea on the clang mailing list. They added some generic annotations to handle ownership of an object, which can be used with any allocation scheme (malloc/free, my_library_malloc/my_library_free, …). They maybe want to add other generic annotations to handle reference counted objects, which could then be used for "dispatch object" (and may be used to replace the less generic ns/cf annotations). And as a clang is a two-way open source project (unlike libdispatch which only push batch of changes once in a while in a read only repository), they have more freedom to talk about future plans. Le 25 oct. 2011 à 23:17, Daniel A. Steffen a écrit :
Hi Mike,
we are definitely very aware of this need, but I can't comment on future plans to address it.
Please feel free to file a bug on bugreporter.apple.com asking for analyzer support for dispatch objects.
Daniel
On Oct 25, 2011, at 10:24, Mike Lewis wrote:
Hi,
I was wondering if there were any plans on adding something to the equivalent of the annotations __attribute__((cf_returns_retained)) to GDC function calls for dispatch objects. Since they're not CFTypes I realize support to clang's static analyzer need to be added. After using a lot of the new dispatch_io calls and having manage dispatch_data_t objects, it seems like there is a much larger use case for analysis support.
Thanks, Mike
-- Michael Lewis lolrus.org mikelikespie@gmail.com _______________________________________________ libdispatch-dev mailing list libdispatch-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/libdispatch-dev
_______________________________________________ libdispatch-dev mailing list libdispatch-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/libdispatch-dev
-- Jean-Daniel
participants (3)
-
Daniel A. Steffen
-
Jean-Daniel Dupas
-
Mike Lewis