<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nagachika</author_name>
  <author_url>https://blog.hatena.ne.jp/nagachika/</author_url>
  <blog_title>ruby trunk changes</blog_title>
  <blog_url>https://ruby-trunk-changes.hatenablog.com/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>Ruby の拡張ライブラリを書く時には、Ruby の処理を呼び出すと例外が発生する可能性があることに気をつけないといけません。たとえば以下のように some_func という関数を呼び出す wrapper method を定義したとします。 extern int some_func(int len, int *ary); VALUE sample_func(VALUE self, VALUE arg) { int *buf; int len, i, result; if (!RB_TYPE_P(arg, T_ARRAY)) rb_raise(rb_eArgError, &quot;arg must be…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fruby-trunk-changes.hatenablog.com%2Fentry%2F20111011%2Fruby_extension_library_howto_tmp_buffer&quot; title=&quot;Ruby の拡張ライブラリでメモリリークを防ぐメモリ確保の方法 - ruby trunk changes&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>2011-10-11 00:00:01</published>
  <title>Ruby の拡張ライブラリでメモリリークを防ぐメモリ確保の方法</title>
  <type>rich</type>
  <url>https://ruby-trunk-changes.hatenablog.com/entry/20111011/ruby_extension_library_howto_tmp_buffer</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
