{"id":9019,"date":"2014-06-19T10:46:14","date_gmt":"2014-06-19T14:46:14","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=9019"},"modified":"2014-06-19T10:47:30","modified_gmt":"2014-06-19T14:47:30","slug":"swroute-function-hooking-in-swift","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/06\/19\/swroute-function-hooking-in-swift\/","title":{"rendered":"SWRoute: Function Hooking in Swift"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/rodionovd\/SWRoute\/wiki\/Function-hooking-in-Swift\">Dmitry Rodionov<\/a> via (<a href=\"https:\/\/delicious.com\/rentzsch\">Wolf Rentzsch<\/a>):<\/p><blockquote cite=\"https:\/\/github.com\/rodionovd\/SWRoute\/wiki\/Function-hooking-in-Swift\"><p>When you pass a function as an argument of a <strong>generic<\/strong> type <code>&lt;T&gt;<\/code>, Swift doesn&rsquo;t pass its raw address directly, but a pointer to a <em>trampoline function<\/em> (see below) along with some meta information about the function. And the trampoline itself <em>is a part of a structure<\/em> wrapping the original function.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Dmitry Rodionov via (Wolf Rentzsch):When you pass a function as an argument of a generic type &lt;T&gt;, Swift doesn&rsquo;t pass its raw address directly, but a pointer to a trampoline function (see below) along with some meta information about the function. And the trampoline itself is a part of a structure wrapping the original function.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[74,71,901,917],"class_list":["post-9019","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-opensource","tag-programming","tag-swift-programming-language","tag-swroute"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=9019"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9019\/revisions"}],"predecessor-version":[{"id":9020,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9019\/revisions\/9020"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=9019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=9019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=9019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}