{"id":7942,"date":"2013-09-24T09:35:44","date_gmt":"2013-09-24T14:35:44","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=7942"},"modified":"2013-09-24T16:25:51","modified_gmt":"2013-09-24T21:25:51","slug":"ios-on-arm64-has-inline-retain-count-in-the-isa","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/09\/24\/ios-on-arm64-has-inline-retain-count-in-the-isa\/","title":{"rendered":"iOS on arm64 Has Inline Retain Count in the isa"},"content":{"rendered":"<p><a href=\"http:\/\/www.sealiesoftware.com\/blog\/archive\/2013\/09\/24\/objc_explain_Non-pointer_isa.html\">Greg Parker<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.sealiesoftware.com\/blog\/archive\/2013\/09\/24\/objc_explain_Non-pointer_isa.html\"><p>Some of the bits still encode the pointer to the object&rsquo;s class. But neither OS X nor iOS actually uses all 64 bits of virtual address space. The Objective-C runtime may use these extra bits to store per-object data like its retain count or whether it has been weakly referenced.<\/p><\/blockquote>\n<p>This is along the lines of what <a href=\"http:\/\/mjtsai.com\/blog\/2013\/09\/10\/arc-vs-mrc-performance\/\">Marcel Weiher recently suggested<\/a> except that the class objects are grouped so that the <a href=\"https:\/\/twitter.com\/gparker\/status\/382608291433431040\">class pointer only needs 30 bits<\/a>. This leaves 19 bits for the extra retain count, plus more for flags such as whether there are weak references or associated objects.<\/p>\n<p>This should be great for reducing memory use and increasing speed. On the Mac, accessing <code>isa<\/code> directly has been discouraged for a long time, so hopefully this optimization will eventually <a href=\"https:\/\/twitter.com\/gparker\/status\/382606173410566144\">show up there as well<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Greg Parker: Some of the bits still encode the pointer to the object&rsquo;s class. But neither OS X nor iOS actually uses all 64 bits of virtual address space. The Objective-C runtime may use these extra bits to store per-object data like its retain count or whether it has been weakly referenced. This is along [&hellip;]<\/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":[575,262,31,469,571,54,138,71],"class_list":["post-7942","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-64-bit","tag-arm","tag-ios","tag-ios7","tag-memory-management","tag-objective-c","tag-optimization","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7942","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=7942"}],"version-history":[{"count":4,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7942\/revisions"}],"predecessor-version":[{"id":7958,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7942\/revisions\/7958"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=7942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=7942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=7942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}