From 52811ab159e7a9927eba9aa30bc14684ff0852fe Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 29 Oct 2013 09:42:45 +0000 Subject: * include/ruby/ruby.h: introduce new flags for T_TYPEDDATA. * RUBY_TYPED_FREE_IMMEDIATELY: free the data given by DATA_PTR() with dfree function immediately. Otherwise (default), the data freed at finalizaton point. * RUBY_TYPED_WB_PROTECTED: make this object with FL_WB_PROTECT (not shady). * gc.c (obj_free): support RUBY_TYPED_FREE_IMMEDIATELY. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/ruby.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 2a33b84dd7..4bac7d3031 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1008,6 +1008,10 @@ void *rb_check_typeddata(VALUE, const rb_data_type_t *); #define RUBY_TYPED_DEFAULT_FREE RUBY_DEFAULT_FREE #define RUBY_TYPED_NEVER_FREE RUBY_NEVER_FREE +/* bits for rb_data_type_struct::flags */ +#define RUBY_TYPED_FREE_IMMEDIATELY 1 /* TYPE field */ +#define RUBY_TYPED_WB_PROTECTED FL_WB_PROTECT + #define Data_Wrap_Struct(klass,mark,free,sval)\ rb_data_object_alloc((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free)) -- cgit v1.2.3