On Jun 25, 2012, at 10:36 , Anna Zaks <[email protected]> wrote:

> 
> On Jun 24, 2012, at 4:56 PM, Ted Kremenek wrote:
> 
>> It's not an official convention for ObjC methods, it's just a heuristic.  
>> How about first looking at the actual SDKs and grepping for methods with 
>> this naming style and seeing (a) how many there are and (b) whether the 
>> heuristic holds?
>> 
> 
> I could not find other publicly exposed ObjC methods that end with "NoCopy" 
> other than NSString and NSData.
> There are a few CF functions with that name; however, they all have different 
> conventions - some take a deallocator, which can choose not to free 
> memory(CFString, CFStream), others just share the pointer (OSData, OSString).
> 
> In this case, we model that the function DOES free memory (and report errors 
> if someone tries to free it afterwards). Not only do I need to know that the 
> function with this name will definitely free, but also which argument is 
> pointing to the buffer. It's hard to do this by doing simple keyword matching 
> on the name.
> 
> Anna.

Fair enough. Thanks for looking into this on my offhand comment.

Jordan

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to