diff --git a/ChangeLog b/ChangeLog index dc20b6f7d3..54d3067c8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ -Wed Jul 8 17:13:36 2009 Nobuyoshi Nakada +Wed Jul 8 18:28:04 2009 Nobuyoshi Nakada - * proc.c ({proc,method}_data_type): typed. + * proc.c ({proc,binding,method}_data_type): typed. Wed Jul 8 16:47:03 2009 Nobuyoshi Nakada 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; }