<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>mikeash.com pyblog/friday-qa-2013-03-22-lets-build-nsinvocation-part-ii.html comments</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2013-03-22-lets-build-nsinvocation-part-ii.html#comments</link><description>mikeash.com Recent Comments</description><lastBuildDate>Sun, 12 Apr 2026 03:11:01 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Carl Lindberg - 2013-08-05 20:22:04</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2013-03-22-lets-build-nsinvocation-part-ii.html#comments</link><description>In fact, after some experimentation... looks like clang uses the stret return versions for basically every structure above 16 bytes, even structures which just have three or four long longs.  Not sure I can figure out why reading the ABI spec but NSMethodSignature reports that, and it will crash at runtime using the wrong one -- NSMethodSignature seems accurate per what the compiler does.</description><guid isPermaLink="true">fedaab37d56923bb5182fb9cdebd0cfd</guid><pubDate>Mon, 05 Aug 2013 20:22:04 GMT</pubDate></item><item><title>Carl Lindberg - 2013-08-04 23:52:23</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2013-03-22-lets-build-nsinvocation-part-ii.html#comments</link><description>I'm not sure the isStretReturn implementation is quite right for all-float or all-double structures; I think such structures &amp;lt;= 16 bytes stay with the normal objc_msgSend and not the stret version.  I'm pretty sure I've seen this in practice with CGPoint vs CGRect (only the latter uses _stret), and the debugDescription of NSMethodSignature (which prints out Apple's isStret value) seems to agree with that.
&lt;br /&gt;
&lt;br /&gt;In terms of the spec, it says "If the size of the aggregate exceeds two eightbytes and the first eightbyte isn’t SSE or any other eightbyte isn’t SSEUP, the whole argument is passed in memory."  So if the size does not exceed two eightbytes, a combination of all-SSE elements seems to not need a stret.   NSMethodSignature does seem to allow &lt;code&gt;{foo=dd}&lt;/code&gt; and &lt;code&gt;{foo=ffff}&lt;/code&gt; as regular returns but changes to the stret return on say &lt;code&gt;{foo=fffff}&lt;/code&gt;.
&lt;br /&gt;
&lt;br /&gt;Minor nit, but... just in case you were interested ;-)
&lt;br /&gt;</description><guid isPermaLink="true">440e1c8572f5e86f9a5f48446b4b6dba</guid><pubDate>Sun, 04 Aug 2013 23:52:23 GMT</pubDate></item><item><title>Mark Aufflick - 2013-04-04 23:08:39</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2013-03-22-lets-build-nsinvocation-part-ii.html#comments</link><description>@Jean-Daniel I assume you mean libffi ?</description><guid isPermaLink="true">edc8eb523a50bc81f8855fde08803553</guid><pubDate>Thu, 04 Apr 2013 23:08:39 GMT</pubDate></item><item><title>Jean-Daniel - 2013-03-23 22:17:20</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2013-03-22-lets-build-nsinvocation-part-ii.html#comments</link><description>I know it would kill all the fun, but just for the record, it is possible to "easily" implement an Invocation class using libff to handle most calling convention subtleties.
&lt;br /&gt;</description><guid isPermaLink="true">33870835ecf66ac756395fc28b062639</guid><pubDate>Sat, 23 Mar 2013 22:17:20 GMT</pubDate></item></channel></rss>
