<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kayactech</author_name>
  <author_url>https://blog.hatena.ne.jp/kayactech/</author_url>
  <blog_title>KAYAC Engineers' Blog</blog_title>
  <blog_url>https://techblog.kayac.com/</blog_url>
  <categories>
    <anon>AdventCalendar2014</anon>
    <anon>ios</anon>
    <anon>objective-c</anon>
  </categories>
  <description>カヤックのAdvent Calendar 9日目は @Gemmbu がお送りします。 iOS でも実行時に確保したメモリ上のコードが動作することはある界隈では有名ですが、 手元で試したことがある方はすくないのではと思います。 そこで実行時に確保したメモリ上に、与えられた数値に 1 加算して返す関数を実装し動作させてみましょう。 流れ 与えられた数値に 1 加算して返すコードを書く アライメントを意識してメモリを確保する 確保したメモリにコードを書き込む 確保したメモリに実行権限を付与する 確保したメモリを関数として実行する サンプルコード #include &lt;unistd.h&gt; #includ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftechblog.kayac.com%2F9_ios_dynamic_function.html&quot; title=&quot;#9 iOS で動的にインクリメント関数を実装する - KAYAC Engineers&amp;#39; Blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2014-12-09 12:00:00</published>
  <title>#9 iOS で動的にインクリメント関数を実装する</title>
  <type>rich</type>
  <url>https://techblog.kayac.com/9_ios_dynamic_function.html</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
