{"id":704,"date":"2017-01-19T22:04:18","date_gmt":"2017-01-19T13:04:18","guid":{"rendered":"http:\/\/www.uturtle.com\/blog\/?p=704"},"modified":"2017-01-19T22:04:18","modified_gmt":"2017-01-19T13:04:18","slug":"c-%ec%96%b8%ec%96%b4-%eb%8d%b0%ec%9d%b4%ed%84%b0-%eb%aa%a8%eb%8d%b8%ec%9d%98-%ea%b0%84%eb%8b%a8%ed%95%9c-%ec%a0%95%eb%a6%ac-lp32-ilp32-lp64-ilp64-llp64","status":"publish","type":"post","link":"https:\/\/www.jinukbaek.com\/blog\/ko\/archives\/704","title":{"rendered":"C \uc5b8\uc5b4 \ub370\uc774\ud130 \ubaa8\ub378\uc758 \uac04\ub2e8\ud55c \uc815\ub9ac (LP32 ILP32 LP64 ILP64 LLP64)"},"content":{"rendered":"<p>64\ube44\ud2b8 Objective-C\uc5d0 \ub300\ud55c \uae00\uc744 \uc4f0\uae30 \uc55e\uc11c\uc11c C \uc5b8\uc5b4 \ub370\uc774\ud130 \ubaa8\ub378\uc774 \ubb34\uc5c7\uc778\uc9c0 \uc774\uc57c\uae30\ud558\uace0\uc790 \ud55c\ub2e4. 64\ube44\ud2b8 \uc2dc\uc2a4\ud15c\uc774 \ub098\uc624\uba74\uc11c \uae30\uc874\uc758 \ud50c\ub7ab\ud3fc\uc5d0 \ub530\ub978 \ud0c0\uc785\ub4e4\uc758 \ud06c\uae30\ub97c \uc7ac\uc815\uc758 \ud574\uc57c\ud560 \ud544\uc694\uac00 \uc0dd\uacbc\ub294\ub370 \uc774\uc5d0 \ub300\ud55c \uc774\uc57c\uae30\uc774\ub2e4. \ud50c\ub7ab\ud3fc\uc5d0 \ub530\ub77c \ubcc0\ud558\ub294 \uae30\ubcf8 \ud0c0\uc785\ub4e4\uc740 \u00a0<code>int<\/code>, <code>void*<\/code>(pointer), <code>long<\/code>, <code>long long<\/code> \ub4f1\uc744 \ub9d0\ud55c\ub2e4. \ubb3c\ub860 16\ube44\ud2b8 CPU\uc5d0\uc11c 32\ube44\ud2b8\ub85c \uc804\ud658\ub418\ub358 \uc2dc\uc808\uc5d0\ub3c4 \uc774 \uc774\uc288\ub294 \uc874\uc7ac\ud558\uc600\ub2e4. \uc608\ub97c \ub4e4\uba74 16\ube44\ud2b8 cpu\uc758 \uacbd\uc6b0 16\ube44\ud2b8\uc758 \uc8fc\uc18c\uac12\uc73c\ub85c\ub294 65.536Byte \ubc16\uc5d0 \ud45c\ud604\ud560 \uc218 \uc5c6\ub294\ub370, \uc774\uc5d0 20\ube44\ud2b8\uc758 \ud3ec\uc778\ud130\ub97c \uc0ac\uc6a9\ud558\uc600\uc5c8\ub2e4(\ubaa8\ub4e0 \uae30\uc885\uc774 \uadf8\ub807\ub2e4\ub294 \uac83\uc740 \uc544\ub2c8\ub2e4). \uc5ec\uae30\uc11c \ubb38\uc81c\ub294 \ucc98\ub9ac \ub2e8\uc704\uac00 16\ube44\ud2b8\uc774\ub2e4 \ubcf4\ub2c8 segment value(\uae30\uc900 \uc8fc\uc18c\ub97c 4\ube44\ud2b8 \uc2dc\ud504\ud2b8)\uc640 offset(segment value\ub85c \ubd80\ud130\uc758 \uc2e4\uc81c \uc88c\ud45c\uc758 \ucc28\uc774)\uacfc \uac19\uc774 \ud3ec\uc778\ud130\ub97c \uc880 \ub354 \ubcf5\uc7a1\ud558\uac8c \uace0\ubbfc\ud558\uc5ec \ucc98\ub9ac\ud574\uc57c\ud588\ub2e4. near pointer\uc640 far pointer\ub85c \uad6c\ubd84\ud558\uc5ec \uc0ac\uc6a9\ud558\ub358 \uc2dc\uc808\uc774 \uc788\uc5c8\ub2e4. \uc5b4\uca0b\ub4e0 32\ube44\ud2b8\uc5d0\uc11c 64\ube44\ud2b8\ub85c \ubc14\ub014 \ub54c\ub3c4 \ube44\uc2b7\ud55c \uc774\uc288\uac00 \uc788\uc5c8\ub294\ub370, \uc774 \uac83\uc774 \uc9c0\uae08 \ub9d0\ud558\ub824\ub294 C\uc5b8\uc5b4 \ub370\uc774\ud130 \ubaa8\ub378\uc774\ub2e4.<\/p>\n<p>\ucef4\ud30c\uc77c\ub7ec\ub098 \ud50c\ub7ab\ud3fc\uc5d0 \ub530\ub77c \uc120\ud0dd\ud55c \ub370\uc774\ud130 \ubaa8\ub378\uc740 \ub2ec\ub77c\uc9c4\ub2e4. \uae30\uc874 32bit \ud504\ub85c\uadf8\ub798\ubc0d \ubaa8\ub378\uc5d0\uc11c\ub294 ILP32\ub97c \uc0ac\uc6a9\ud55c\ub2e4. LP32\ub294 \uae30\uc874 Win16CAPI\uc5d0\uc11c \uc0ac\uc6a9\ub418\uace4 \ud588\ub2e4. LLP64\uc758 \uacbd\uc6b0 \uc708\ub3c4\uc6b0\uc5d0\uc11c \ucc44\ud0dd[2] \ud588\uc73c\uba70, LP64\uc758 \uacbd\uc6b0 \uc77c\ubd80 \uc720\ub2c9\uc2a4 \uacc4\uc5f4\uc5d0\uc11c \uc0ac\uc6a9\ud55c\ub2e4.<\/p>\n<p>\uc5ec\uae30\uc11c L\uc740 <code>long<\/code>\uc5d0 \ud574\ub2f9\ud558\uba70, P\ub294 pointer size\ub97c \uc774\uc57c\uae30 \ud558\uba70, I\ub294 <code>int<\/code>\ub97c \uc758\ubbf8, LL\uc740 <code>long long<\/code>\uc744 \uc758\ubbf8\ud55c\ub2e4. <code>long long<\/code>\uc758 \uacbd\uc6b0 \uc9c0\uc6d0\ud558\uc9c0 \ucef4\ud30c\uc77c\ub7ec\uc5d0 \ub530\ub77c \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc744 \uc218\ub3c4 \uc788\ub2e4[2].<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Datatype<\/b><\/td>\n<td><b>LP64<\/b><\/td>\n<td><b>ILP64<\/b><\/td>\n<td><b>LLP64<\/b><\/td>\n<td><b>ILP32<\/b><\/td>\n<td><b>LP32<\/b><\/td>\n<\/tr>\n<tr>\n<td>char<\/td>\n<td>8<\/td>\n<td>8<\/td>\n<td>8<\/td>\n<td>8<\/td>\n<td>8<\/td>\n<\/tr>\n<tr>\n<td>short<\/td>\n<td>16<\/td>\n<td>16<\/td>\n<td>16<\/td>\n<td>16<\/td>\n<td>16<\/td>\n<\/tr>\n<tr>\n<td>int<\/td>\n<td>32<\/td>\n<td>64<\/td>\n<td>32<\/td>\n<td>32<\/td>\n<td>16<\/td>\n<\/tr>\n<tr>\n<td>long<\/td>\n<td>64<\/td>\n<td>64<\/td>\n<td>32<\/td>\n<td>32<\/td>\n<td>32<\/td>\n<\/tr>\n<tr>\n<td>long long<\/td>\n<td><\/td>\n<td><\/td>\n<td>64<\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>pointer<\/td>\n<td>64<\/td>\n<td>64<\/td>\n<td>64<\/td>\n<td>32<\/td>\n<td>32<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\uc704\uc758 \ud14c\uc774\ube14\uc744 \ubcf4\uba74 \uac01 \ub370\uc774\ud130 \ubaa8\ub378\uc5d0 \ub530\ub77c\uc11c \uc5b4\ub5a4 \uac12\uc744 \uac00\uc9c0\uac8c \ub418\ub294\uc9c0 \uc54c \uc218 \uc788\ub2e4. pointer\uc758 \uacbd\uc6b0 \ud655\uc2e4\ud788 \ub2e4\ub974\uae30 \ub54c\ubb38\uc5d0 \uae30\uc874 32bit \ucf54\ub4dc\ub97c 64bit\ub85c \ubcc0\uacbd\ud560 \ub54c \uaf2d \uc8fc\uc758 \ud558\uc5ec\uc57c \ud55c\ub2e4. long type\uc758 \ubcc0\uc218\uc5d0 \ud3ec\uc778\ud130 \uac12\uc744 \ud560\ub2f9\ud558\uc5ec \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0\ub3c4 \uba40\ud2f0\ud50c\ub7ab\ud3fc\uc744 \uc9c0\uc6d0\ud558\uae30\uc704\ud55c \uac1c\ubc1c\uc744 \ud55c\ub2e4\uac70\ub098 \ud560 \ub54c \uc704\ud5d8\ud558\uae30 \ub54c\ubb38\uc5d0 \uc798 \uace0\ub824\ud574\uc11c \uc120\ud0dd\ud574\uc57c\ud55c\ub2e4.<\/p>\n<p>\ucc28\ub77c\ub9ac C99\uc5d0\uc11c \uc815\ud655\ud55c \uc0ac\uc774\uc988\uac00 \uc9c0\uc815\ub41c \ub370\uc774\ud130 \ud0c0\uc785\uc774 \ucd94\uac00\ub418\uc5c8\ub294\ub370, \ucef4\ud30c\uc77c\ub7ec\uac00 C99\uc640 \ud638\ud658\ub41c\ub2e4\uba74 \uc774\ub97c \uc120\ud0dd\ud558\ub294 \uac83\uc774 \uc88b\uc744 \uc218\ub3c4 \uc788\ub2e4. <code>int8_t<\/code>, <code>uint8_t<\/code>, <code>int32_t<\/code>, <code>int64_t<\/code> \ub4f1\uacfc \uac19\uc774 <code>unsigned<\/code>\ub41c \ud615\ud0dc\uc640 8,16,32,64\ub97c \uc9c0\uc6d0\ud55c\ub2e4. \ud558\uc9c0\ub9cc \ubb38\uc81c \uc810\ub3c4 \uc788\ub294\ub370, <code>int32_t<\/code>\ub97c \uc37c\ub294\ub370 16\ube44\ud2b8 \ucef4\ud4e8\ud130\uc5d0\uc11c \ub3d9\uc791\uc2dc\ud0a8\ub2e4\uba74 \uc131\ub2a5\uc774 \ub098\ube60\uc9c8 \uc218\ub3c4 \uc788\ub2e4\ub358\uc9c0 \ud558\uae30 \ub54c\ubb38\uc5d0 \uc0c1\ud669\uc5d0 \uc54c\ub9de\uac8c \uad6c\ud604\ud574\uc57c\ud560 \uac83\uc774\ub2e4. 32\ube44\ud2b8\uc640 64\ube44\ud2b8 \ube4c\ub4dc\ub97c \ub458 \ub2e4 \uc9c0\uc6d0\ud558\ub294 \uacbd\uc6b0\ub3c4 \ub9c8\ucc2c\uac00\uc9c0\ub85c \ub370\uc774\ud130 \ud0c0\uc785\uc758 \uc0ac\uc774\uc988\ub97c \uace0\ub824\ud574\uc57c \ud55c\ub2e4. \ub610\ud55c <code>size_t<\/code>\uc778 \ub370\uc774\ud130\ub3c4 \uc0ac\uc6a9\ud560 \ub54c \uc0ac\uc774\uc988\uc5d0 \uc8fc\uc758\ud574\uc57c\ud55c\ub2e4.<\/p>\n<h4>\ucc38\uace0\uc790\ub8cc<\/h4>\n<p>[1] Unix.org, &#8220;64-Bit Programming Models: Why LP64?&#8221;, \u00a0http:\/\/www.unix.org\/version2\/whatsnew\/lp64_wp.html<\/p>\n<p class=\"p1\">[2] Hook, B. (2005). Write Portable Code: An Introduction to Developing Software for Multiple Platforms. No Starch Press., pp85-89<\/p>\n","protected":false},"excerpt":{"rendered":"<p>64\ube44\ud2b8 Objective-C\uc5d0 \ub300\ud55c \uae00\uc744 \uc4f0\uae30 \uc55e\uc11c\uc11c C \uc5b8\uc5b4 \ub370\uc774\ud130 \ubaa8\ub378\uc774 \ubb34\uc5c7\uc778\uc9c0 \uc774\uc57c\uae30\ud558\uace0\uc790 \ud55c\ub2e4. 64\ube44\ud2b8 \uc2dc\uc2a4\ud15c\uc774 \ub098\uc624\uba74\uc11c \uae30\uc874\uc758 \ud50c\ub7ab\ud3fc\uc5d0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[44],"tags":[404,408,396,400,402,394,398,406],"class_list":["post-704","post","type-post","status-publish","format-standard","hentry","category-computer-etc","tag-c---","tag-c","tag-ilp32","tag-ilp64","tag-llp64","tag-lp32","tag-lp64","tag-406"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8gT1J-bm","_links":{"self":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts\/704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/comments?post=704"}],"version-history":[{"count":2,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts\/704\/revisions"}],"predecessor-version":[{"id":706,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts\/704\/revisions\/706"}],"wp:attachment":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/media?parent=704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/categories?post=704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/tags?post=704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}