summaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-08 09:28:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-08 09:28:09 +0000
commit56d9188439180f296bd5f98b25c5e5d0b8e841ec (patch)
tree5a185079672f24e8bf1d7d0df4616a3690982dad /proc.c
parent107b8a297d260cbc8923a6047b586342fd4f8b45 (diff)
downloadruby-56d9188439180f296bd5f98b25c5e5d0b8e841ec.tar.gz
ruby-56d9188439180f296bd5f98b25c5e5d0b8e841ec.tar.xz
ruby-56d9188439180f296bd5f98b25c5e5d0b8e841ec.zip
* proc.c ({proc,binding,method}_data_type): typed.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index 04be7674c..a1b2feea1 100644
--- a/proc.c
+++ b/proc.c
@@ -255,12 +255,25 @@ binding_mark(void *ptr)
RUBY_MARK_LEAVE("binding");
}
+static size_t
+binding_memsize(void *ptr)
+{
+ return ptr ? sizeof(rb_binding_t) : 0;
+}
+
+static const rb_data_type_t binding_data_type = {
+ "binding",
+ binding_mark,
+ binding_free,
+ binding_memsize,
+};
+
static VALUE
binding_alloc(VALUE klass)
{
VALUE obj;
rb_binding_t *bind;
- obj = Data_Make_Struct(klass, rb_binding_t, binding_mark, binding_free, bind);
+ obj = TypedData_Make_Struct(klass, rb_binding_t, &binding_data_type, bind);
return obj;
}