swift函数的调用约定
The convention of the function, indicated by the
attribute. This is similar to the language-level
@conventionattribute, though SIL extends the set of supported conventions with additional distinctions not exposed at the language level:@convention(thin)indicates a "thin" function reference, which uses the Swift calling convention with no special "self" or "context" parameters.@convention(thick)indicates a "thick" function reference, which uses the Swift calling convention and carries a reference-counted context object used to represent captures or other state required by the function. This attribute is implied by@callee_ownedor@callee_guaranteed.@convention(block)indicates an Objective-C compatible block reference. The function value is represented as a reference to the block object, which is anid-compatible Objective-C object that embeds its invocation function within the object. The invocation function uses the C calling convention.@convention(c)indicates a C function reference. The function value carries no context and uses the C calling convention.@convention(objc_method)indicates an Objective-C method implementation. The function uses the C calling convention, with the SIL-levelselfparameter (by SIL convention mapped to the final formal parameter) mapped to theselfand_cmdarguments of the implementation.@convention(method)indicates a Swift instance method implementation. The function uses the Swift calling convention, using the specialselfparameter.@convention(witness_method)indicates a Swift protocol method implementation. The function's polymorphic convention is emitted in such a way as to guarantee that it is polymorphic across all possible implementors of the protocol.
https://github.com/apple/swift/blob/master/docs/SIL.rst#properties-of-types
swift函数的调用约定的更多相关文章
- C/C++/动态链接库DLL中函数的调用约定与名称修饰
参见:http://blog.twofei.com/cc/impl/calling-convension.html 调用约定(Calling Convention)是指在程序设计语言中为了实现函数调用 ...
- C/C++:函数的调用约定(Calling Convention)和名称修饰(Decorated Name)以及两者不匹配引起的问题
转自:http://blog.csdn.net/zskof/article/details/3475182 注:C++有着与C不同的名称修饰,主要是为了解决重载(overload):调用约定则影响函数 ...
- 如何在C语言中调用Swift函数
在Apple官方的<Using Swift with Cocoa and Objectgive-C>一书中详细地介绍了如何在Objective-C中使用Swift的类以及如何在Swift中 ...
- C/C++:函数的编译方式与调用约定以及extern “C”的使用
转自:https://www.cnblogs.com/qinfengxiaoyue/archive/2013/02/04/2891908.html 函数在C++编译方式与C编译方式下的主要不同在于:由 ...
- X86调用约定 calling convention
http://zh.wikipedia.org/wiki/X86%E8%B0%83%E7%94%A8%E7%BA%A6%E5%AE%9A 这里描述了在x86芯片架构上的调用约定(calling con ...
- 空函数有参函数调用参数的注意事项Swift 1.1语言
空函数有参函数调用参数的注意事项Swift 1.1语言 7.2.3 空函数 空函数有参函数调用参数的注意事项Swift 1.1语言空函数是函数中最简单的形式.在空函数中,函数只有一个空壳,里面是没有 ...
- x64 stack walking、调用约定、函数参数识别
k = <rsp> <rip> <frame_count>x64下manual stack walking与x86不同,x86一般情况下有ebp chain,x64 ...
- 【原创+整理】简述何为调用约定,函数导出名以及extern C
何为调用约定 调用约定指的是函数在调用时会按照不同规则,翻译成不同的汇编代码.这和参数的压栈顺序和栈的清理方式相关,也就是说不同的调用约定,这些方式会做相应改变.一般编译器是以默认的调用约定编译一份代 ...
- C C++ ARM X86 函数 方法 的调用约定
参考:https://bbs.pediy.com/thread-224583.htm 整理成表格方便查询 cdecl(C规范), stdcall(WinAPI默认), fastcall, ATPCS( ...
随机推荐
- JQ的offset().top与js的offsetTop区别详解
一.前言 最近在做一个图片懒加载的插件,就纵轴(Y轴)而言,我需要时时获取图片的上偏移量,好判断是否已进入视图区域,而我所理解的是offsetTop应该是跟offset().top一样的,然后陷入了因 ...
- Python vtk学习(1)
Vtk,(visualization toolkit)是一个开源的免费软件系统,主要用于三维计算机图形学.图像处理和可视化.Vtk是在面向对象原理的基础上设计和实现的,它的内核是用C++构建的,包含有 ...
- JavaWeb学习 (三)————Tomcat服务器学习和使用(二)
一.打包JavaWeb应用 在Java中,使用"jar"命令来对将JavaWeb应用打包成一个War包,jar命令的用法如下:
- mybatis mapper xml文件的导入方式和查询方式
mybatis mapper xml文件的导入方式和查询方式 ssm框架 Mybatis mapper与SQLSession的关系 每个基于MyBatis的应用都是以一个SqlSessionFact ...
- SpringMVC源码阅读:过滤器
1.前言 SpringMVC是目前J2EE平台的主流Web框架,不熟悉的园友可以看SpringMVC源码阅读入门,它交代了SpringMVC的基础知识和源码阅读的技巧 本文将通过源码(基于Spring ...
- JAVAEmail工具错误java.lang.ClassNotFoundException: javax.activation.DataSource
JDK9以上或JDK6以下使用mail.jar包不加JAF的activation.jar包会抛出该错误!JDK6以上不需要加该jar包: 参考原文 https://stackoverflow.com/ ...
- JDK动态代理与CGLib动态代理相关问题
导读: 1.JDK动态代理原理是什么?为什么不支持类的代理? 2.JDK动态代理实例 3.CGLib代理原理是什么? 4.CGLib代理实例 5.JDK动态代理与CGLib代理的区别是什么? 6.总结 ...
- WPF通过附加属性控制窗口关闭
场景1 当使用 ShowDialog() 方式显示窗口时,通过定义附加属性的方式可实现在 ViewModel 中进行数据绑定(bool?)来控制子窗口的显示和关闭 public class ExWin ...
- iphone 上微信的“复制链接”功能复制出来的是修改前的链接
问题描述: 在 iOS 系统中,用微信打开了 A 页面的链接,然后由 A 页面进入 B 页面 在 B 页面打开微信右上角菜单,使用“复制链接”功能 最后粘贴出来的链接是 A 页面的链接 分析原因: 这 ...
- AWT初步— 事件处理模型
之前学习的内容只能形成一个用户界面,而用户不能对其有实际的操作,也就是说用户界面没有任何功能.要能够让图形界面接收用户的操作,就必须给各个组件加上事件处理机制.在事件处理的过程中,主要涉及三类对象: ...