{"categories":["Python","JIT"],"version":"1.0","height":"190","provider_name":"Hatena Blog","author_name":"n7shi","width":"100%","type":"rich","blog_title":"\u4e03\u8a8c\u306e\u958b\u767a\u65e5\u8a18","title":"Python\u3067\u30dd\u30a4\u30f3\u30bf\u7d4c\u7531\u306e\u30e1\u30e2\u30ea\u30a2\u30af\u30bb\u30b9","published":"2012-06-10 02:36:02","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2F7shi.hateblo.jp%2Fentry%2F2012%2F06%2F10%2F023602\" title=\"Python\u3067\u30dd\u30a4\u30f3\u30bf\u7d4c\u7531\u306e\u30e1\u30e2\u30ea\u30a2\u30af\u30bb\u30b9 - \u4e03\u8a8c\u306e\u958b\u767a\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://7shi.hateblo.jp/entry/2012/06/10/023602","description":"Python\u3067malloc()\u3057\u305f\u30e1\u30e2\u30ea\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a66\u3057\u307e\u3057\u305f\u3002\u623b\u308a\u5024\u3092 POINTER(c_ubyte) \u3078\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u3068\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002\u203b \u4f8b\u306f32bit Windows\u9650\u5b9a\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002UNIX\u7cfb\u3067\u306flibc\u306e\u30ed\u30fc\u30c9\u65b9\u6cd5\u304c\u5c11\u3057\u9055\u3044\u307e\u3059\u3002 from ctypes import * malloc = cdll.msvcrt.malloc malloc.restype = POINTER(c_ubyte) free = cdll.msvcrt.free printf = cdll.msvcrt.printf p = malloc(4) p[0] = ord(\"a\") p[1] = ord(\u2026","image_url":null,"author_url":"https://blog.hatena.ne.jp/n7shi/","blog_url":"https://7shi.hateblo.jp/"}