{"id":1229,"date":"2018-09-20T13:29:37","date_gmt":"2018-09-20T04:29:37","guid":{"rendered":"http:\/\/www.applabo.co.jp\/endo-blog\/?p=1229"},"modified":"2018-10-14T16:41:58","modified_gmt":"2018-10-14T07:41:58","slug":"c%e3%81%a7gc%e3%80%82gcc%e3%81%98%e3%82%83%e3%81%aa%e3%81%84%e3%82%88","status":"publish","type":"post","link":"https:\/\/www.applabo.co.jp\/endo-blog\/?p=1229","title":{"rendered":"C\u3067GC\u3002GCC\u3058\u3083\u306a\u3044\u3088"},"content":{"rendered":"<p>\u6065\u305a\u304b\u3057\u306a\u304c\u3089\u3001\u4eca\u307e\u3067C\u3067GC\u304c\u51fa\u6765\u308b\u3068\u306f\u601d\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u3044\u3084\u3001\u51fa\u6765\u308b\u3060\u308d\u3046\u306a\u3041\u3068\u3044\u3046\u76f4\u611f\u306f\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u300c\u8abf\u3079\u3088\u3046\u300d\u3068\u3044\u3046\u3068\u3053\u308d\u307e\u3067\u306f\u30b3\u30b3\u30ed\u304c\u52d5\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u307e\u3041\u3001\u6240\u8a6e\u300c\u6b63\u3057\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3051\u3070\u300dGC\u306a\u3093\u3066\u3044\u3089\u3093\u306e\u3067\u3059\u3002<br \/>\n\u3042\u3093\u306a\u306e\u98fe\u308a\u3067\u3059\u3002\u5049\u3044\u4eba\u306b\u306f\u305d\u308c\u304c\u308f\u304b\u3089\u3093\u306e\u3067\u3059\u3088\u3002<\/p>\n<p>\u3067\u3082\u3001\u79c1\u306f\u795e\u69d8\u3067\u306f\u7121\u3044\u306e\u3067\u3001\u6b63\u3057\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u66f8\u3051\u308b\u81ea\u4fe1\u304c\u306a\u3044\u306e\u3067\u3001\u3084\u3063\u3071\u308aGC\u4f7f\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u7acb\u3061\u307e\u3057\u305f\u3002<\/p>\n<p>\u5e78\u3044\u3001\u6700\u8fd1C\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u6a5f\u4f1a\u3092\u9802\u304d\u307e\u3057\u3066\uff08\u3044\u3084\u3001Python\u304c\u3042\u307e\u308a\u306b\u3082\u9045\u3059\u304e\u3066\u3001\u8a71\u306b\u306a\u3089\u3093\u306e\u3067C\u3067\u66f8\u304d\u59cb\u3081\u305f\u308f\u3051\u3067\u3059\u304c\uff09\u3001\u3082\u3061\u308d\u3093malloc\u306a\u3093\u304b\u3092\u4f7f\u3044\u5012\u3057\u3066\u30fb\u30fb\u30fb\u30fb<\/p>\n<p>\u3067\u3001\u809d\u5fc3\u306eGC\u3067\u3059\u304c\u3001\u306a\u3093\u3067\u3082\u3001\u300cBoehm GC\u300d\u3068\u3044\u3046GC\u304c\u3042\u308b\u305d\u3046\u3067\u3002\u3044\u3084\u3001\u6065\u305a\u304b\u3057\u306a\u304c\u3089\u3001\u52c9\u5f37\u4e0d\u8db3\u3067\u3057\u305f\u3002\u3082\u3046\u3001\uff12\uff10\u5e74\u8fd1\u304f\u524d\u304b\u3089\u3042\u308b\u3088\u3046\u3067\u3059\u30fb\u30fb\u30fb\u30fb<\/p>\n<p>\u307e\u3041\u3001\u6c17\u3092\u53d6\u308a\u76f4\u3057\u3066<\/p>\n<blockquote><p>apt-get -y install libgc-dev<\/p><\/blockquote>\n<p>\u3042\u3002\u6700\u8fd1Linux\u591a\u3044\u3093\u3067\u3059\u3088\u3002Debian\u7cfb\u3067\u3059\u3002armbian\u3063\u3066\u8a00\u3044\u307e\u3059\u3002\u3082\u3046\u3001\u3069\u3063\u3077\u308a\u3067\u3059\u3002<br \/>\n\u307e\u3060\u307e\u3060 FreeBSD \u3082\u4f7f\u3063\u3066\u307e\u3059\u3051\u3069\u3001\/usr\/ports\u3068\u304b\u5fd8\u308c\u304b\u3051\u3066\u307e\u3059\u3002<br \/>\n\u4e45\u3057\u3076\u308a\u306bmake install clean\u3068\u304b\u3057\u305f\u3089\u3001\u300c<a href=\"http:\/\/www.aztec.gr.jp\/wp\/freebsd\/unknown-modifier-t\">&#8220;t&#8221;\u306a\u3093\u3066\u3057\u3089\u306d\u30fc<\/a>\u300d\u3063\u3066\u6012\u3089\u308c\u3066\u51f9\u3093\u3067\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001GC\u304c\u7c21\u5358\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u3066\u3001<\/p>\n<blockquote><p>gcc -lgc hogehoge.c<\/p><\/blockquote>\n<p>\u3068\u304b\u3059\u308c\u3070\u7c21\u5358\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u51fa\u6765\u307e\u3059\u3002<\/p>\n<blockquote><p>#include &lt;gc.h&gt;<\/p><\/blockquote>\n<p>\u304c\u5fc5\u9808\u3067\u3001<\/p>\n<blockquote><p>GC_MALLOC<\/p><\/blockquote>\n<p>\u3092malloc\u306e\u4ee3\u308f\u308a\u306b\u4f7f\u3048\u3070\u304a\u3063\u3051\u3002free\u306f\u6d88\u3057\u307e\u3057\u3087\u3046\u3002\u6d88\u3055\u306a\u3044\u3068\u30d7\u30ed\u30b0\u30e9\u30e0\u843d\u3061\u307e\u3059\u3002<\/p>\n<p>\u7c21\u5358\u306b\u5b9f\u88c5\u51fa\u6765\u307e\u3057\u305f\u3002\u3053\u308c\u3067\u3001\u300c\u30e1\u30e2\u30ea\u7ba1\u7406\u306e\u82e6\u52b4\u304b\u3089\u3082\u958b\u653e\u3055\u308c\u308b!?\u300d\u3068\u559c\u3073\u52c7\u3093\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u3002\u3002\u3002\u3002\u3002<\/p>\n<p>\u7d50\u8ad6\uff1aGC\u8f9e\u3081\u307e\u3057\u305f\u3002<\/p>\n<p>\u3044\u3084\u306d\u3001GC\u3063\u3066\u30e1\u30e2\u30ea\u7ba1\u7406\u306b\u7d50\u69cb\u30b3\u30b9\u30c8\u304b\u304b\u308b\u3093\u3067\u3059\u306d\u3002CPU\u304c\uff11\uff10\uff05\u4e0a\u304c\u308a\u307e\u3057\u305f\u3002<br \/>\n\u305d\u3093\u306a\u306b\u4f59\u88d5\u306e\u3042\u308b\u30de\u30b7\u30f3\u3058\u3083\u306a\u3044\u3093\u3060\u3088\u3002\u30ea\u30bd\u30fc\u30b9\u5927\u4e8b\u306a\u3093\u3060\u3088\u3002<\/p>\n<p>\u30a2\u30d7\u30ea\u3068\u304b\u3001\u3061\u3083\u3093\u3068\u3057\u305f\u30b5\u30fc\u30d0\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306a\u3093\u304b\u306b\u306f\u3068\u3066\u3082\u826f\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\n\uff08\u3055\u3063\u3071\u308a\u30d5\u30a9\u30ed\u30fc\u306b\u306a\u3063\u3066\u307e\u305b\u3093\u304c\uff09<\/p>\n<p>\u4eca\u56de\u306f\u3001\u304b\u306a\u308a\u9ad8\u901f\u306b\u52d5\u3044\u3066\u3044\u308b\u30b7\u30b9\u30c6\u30e0\u306e\u30e1\u30e2\u30ea\u7ba1\u7406\u3060\u3063\u305f\u306e\u3067\u3001\u307e\u3041\u3001\u305d\u3089\u305d\u3046\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u3068\u3044\u3053\u3068\u3067\u3001\u3061\u3087\u3063\u3068\u5b9f\u9a13\u3057\u3066\u3044\u3044\u6c17\u5206\u306b\u306a\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>p.s.<br \/>\n\u3067\u3082\u3001\u79c1\u306f\u3001GC_MALLOC\u3068\u3044\u3046\u5927\u6587\u5b57\u3060\u3051\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u308b\u95a2\u6570\u306b\u9055\u548c\u611f\u3092\u611f\u3058\u305a\u306b\u306f\u3044\u3089\u308c\u307e\u305b\u3093\u3002\u4fe1\u3058\u308b\u304b\u4fe1\u3058\u306a\u3044\u304b\u306f\u30a2\u30ca\u30bf\u6b21\u7b2c\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6065\u305a\u304b\u3057\u306a\u304c\u3089\u3001\u4eca\u307e\u3067C\u3067GC\u304c\u51fa\u6765\u308b\u3068\u306f\u601d\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u3044\u3084\u3001\u51fa\u6765\u308b\u3060\u308d\u3046\u306a\u3041\u3068\u3044\u3046\u76f4\u611f\u306f\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u300c\u8abf\u3079\u3088\u3046\u300d\u3068\u3044\u3046\u3068\u3053\u308d\u307e\u3067\u306f\u30b3\u30b3\u30ed\u304c\u52d5\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u307e\u3041\u3001\u6240\u8a6e\u300c\u6b63\u3057\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3051\u3070\u300dGC\u306a\u3093\u3066 &#8230; <\/p>\n<p class=\"moree\"><a class=\"more\" href=\"https:\/\/www.applabo.co.jp\/endo-blog\/?p=1229\">\u7d9a\u304d\u3092\u8aad\u3080 <i class=\"fa fa-arrow-circle-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[25,24,3,1],"tags":[],"class_list":["post-1229","post","type-post","status-publish","format-standard","hentry","category-orange-pi","category-sbc","category-uneoae","category-ieia"],"_links":{"self":[{"href":"https:\/\/www.applabo.co.jp\/endo-blog\/index.php?rest_route=\/wp\/v2\/posts\/1229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.applabo.co.jp\/endo-blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.applabo.co.jp\/endo-blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.applabo.co.jp\/endo-blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.applabo.co.jp\/endo-blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1229"}],"version-history":[{"count":2,"href":"https:\/\/www.applabo.co.jp\/endo-blog\/index.php?rest_route=\/wp\/v2\/posts\/1229\/revisions"}],"predecessor-version":[{"id":1231,"href":"https:\/\/www.applabo.co.jp\/endo-blog\/index.php?rest_route=\/wp\/v2\/posts\/1229\/revisions\/1231"}],"wp:attachment":[{"href":"https:\/\/www.applabo.co.jp\/endo-blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.applabo.co.jp\/endo-blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.applabo.co.jp\/endo-blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}