[前][次][番号順一覧][スレッド一覧]

ruby-changes:39994

From: nobu <ko1@a...>
Date: Wed, 7 Oct 2015 21:40:43 +0900 (JST)
Subject: [ruby-changes:39994] nobu:r52075 (trunk): ruby.h: RB_OBJ_FROZEN_RAW

nobu	2015-10-07 21:40:34 +0900 (Wed, 07 Oct 2015)

  New Revision: 52075

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52075

  Log:
    ruby.h: RB_OBJ_FROZEN_RAW
    
    * include/ruby/ruby.h (RB_OBJ_FROZEN_RAW): split from
      RB_OBJ_FROZEN.  valid only for non-special-const objects.

  Modified files:
    trunk/include/ruby/ruby.h
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 52074)
+++ include/ruby/ruby.h	(revision 52075)
@@ -1312,7 +1312,8 @@ struct RStruct { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1312
     (RB_OBJ_TAINTABLE(x) && RB_FL_ABLE(s)) ? \
     RB_OBJ_INFECT_RAW(x, s) : 0)
 
-#define RB_OBJ_FROZEN(x) (RB_FL_ABLE(x) ? !!(RBASIC(x)->flags&RUBY_FL_FREEZE) : 1)
+#define RB_OBJ_FROZEN_RAW(x) (RBASIC(x)->flags&RUBY_FL_FREEZE)
+#define RB_OBJ_FROZEN(x) (!RB_FL_ABLE(x) || RB_OBJ_FROZEN_RAW(x))
 #define RB_OBJ_FREEZE_RAW(x) (RBASIC(x)->flags |= RUBY_FL_FREEZE)
 #define RB_OBJ_FREEZE(x) rb_obj_freeze_inline((VALUE)x)
 
@@ -1339,6 +1340,7 @@ struct RStruct { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1340
 #define OBJ_UNTRUST(x) RB_OBJ_UNTRUST(x)
 #define OBJ_INFECT_RAW(x,s) RB_OBJ_INFECT_RAW(x,s)
 #define OBJ_INFECT(x,s) RB_OBJ_INFECT(x,s)
+#define OBJ_FROZEN_RAW(x) RB_OBJ_FROZEN_RAW(x)
 #define OBJ_FROZEN(x) RB_OBJ_FROZEN(x)
 #define OBJ_FREEZE_RAW(x) RB_OBJ_FREEZE_RAW(x)
 #define OBJ_FREEZE(x) RB_OBJ_FREEZE(x)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]