summaryrefslogtreecommitdiff
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
commitabbd115cae8f6db1bfe1c349ed6f928ac96c6622 (patch)
tree5a185079672f24e8bf1d7d0df4616a3690982dad /proc.c
parentebd13e3eed9e3c4f4eb5b2122590420a76f70184 (diff)
* proc.c ({proc,binding,method}_data_type): typed.
git-svn-id: svn+ssh://ci.ruby-lang.org/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 04be7674c9..a1b2feea19 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;
}