<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>totem_3</author_name>
  <author_url>https://blog.hatena.ne.jp/totem_3/</author_url>
  <blog_title>エンジニアですよ！</blog_title>
  <blog_url>https://totem3.hatenablog.jp/</blog_url>
  <categories>
    <anon>rust</anon>
  </categories>
  <description>最近JITコンパイラを書いていて、実行可能なメモリ領域に命令列を直接書き込んで実行、ということがしたかった。 cならmmapなどで、PROT_EXECフラグを立ててメモリを確保するか、mprotectでPROT_EXECフラグを立ててやればいいという認識。 まず思いついたのは単純にhttps://crates.io/crates/libcを使う方法で、それは普通に思ったとおりにできて、最終的にそれ以外の方法はわからなかった。 こんなイメージ Rust Playground Rust 側で操作ができないと不便なので、 raw pointer として u8 で変数を宣言しておく。 で、別途 mma…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftotem3.hatenablog.jp%2Fentry%2F2018%2F08%2F20%2F214313&quot; title=&quot; Rustで実行可能なメモリを確保 - エンジニアですよ！&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>2018-08-20 21:43:13</published>
  <title> Rustで実行可能なメモリを確保</title>
  <type>rich</type>
  <url>https://totem3.hatenablog.jp/entry/2018/08/20/214313</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
