diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-08 09:28:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-08 09:28:09 +0000 |
commit | 56d9188439180f296bd5f98b25c5e5d0b8e841ec (patch) | |
tree | 5a185079672f24e8bf1d7d0df4616a3690982dad /proc.c | |
parent | 107b8a297d260cbc8923a6047b586342fd4f8b45 (diff) | |
download | ruby-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.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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; } |