diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-26 12:37:11 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-26 12:37:11 +0000 |
commit | a20a14727f4c15fad7a07b8bd7c39074895aa845 (patch) | |
tree | 267bf412e9975868fe4922063ae7b463c940af12 /include/ruby/ruby.h | |
parent | ea54c59a8e7daf3f0a05eead6415f39c52e3a0fc (diff) |
* hash.c, include/ruby/ruby.h: support WB protected hash.
* constify RHash::ifnone and make new macro RHASH_SET_IFNONE().
* insert write barrier for st_update().
* include/ruby/intern.h: declare rb_hash_set_ifnone(hash, ifnone).
* marshal.c (r_object0): use RHASH_SET_IFNONE().
* ext/openssl/ossl_x509name.c (Init_ossl_x509name): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r-- | include/ruby/ruby.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 8bfd351391..9404d97d80 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -689,6 +689,11 @@ VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type); #ifndef RGENGC_WB_PROTECTED_ARRAY #define RGENGC_WB_PROTECTED_ARRAY 1 #endif + +#ifndef RGENGC_WB_PROTECTED_HASH +#define RGENGC_WB_PROTECTED_HASH 1 +#endif + #ifndef RGENGC_WB_PROTECTED_STRING #define RGENGC_WB_PROTECTED_STRING 1 #endif @@ -960,7 +965,7 @@ struct RHash { struct RBasic basic; struct st_table *ntbl; /* possibly 0 */ int iter_lev; - VALUE ifnone; + const VALUE ifnone; }; /* RHASH_TBL allocates st_table if not available. */ #define RHASH_TBL(h) rb_hash_tbl(h) @@ -968,6 +973,7 @@ struct RHash { #define RHASH_IFNONE(h) (RHASH(h)->ifnone) #define RHASH_SIZE(h) (RHASH(h)->ntbl ? RHASH(h)->ntbl->num_entries : 0) #define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0) +#define RHASH_SET_IFNONE(h, ifnone) rb_hash_set_ifnone((VALUE)h, ifnone) struct RFile { struct RBasic basic; |