diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-04 01:59:49 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-04 01:59:49 +0000 |
commit | ba4672c2cb90c85bfeb7cac3295c68b116c7c6f5 (patch) | |
tree | 042fbfe4ba646f33cf022c2cf80737de5c04a464 | |
parent | b2a7a289e046cbbfc7f439f312a7204c174c3869 (diff) | |
download | ruby-ba4672c2cb90c85bfeb7cac3295c68b116c7c6f5.tar.gz |
ar_table_entry::hash should be `st_hash_t`.
* hash.c: the type of `ar_table_entry::hash` is not a `VALUE`,
but a `st_hash_t`.
Also `st_hash_t` is not a `st_data_t`, but `st_index_t` (same as st.c).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | hash.c | 60 |
1 files changed, 30 insertions, 30 deletions
@@ -48,35 +48,6 @@ #define COPY_DEFAULT(hash, hash2) copy_default(RHASH(hash), RHASH(hash2)) -/* - * RHASH_AR_TABLE_P(h): - * * as.ar == NULL or - * as.ar points ar_table. - * * as.ar is allocated by transient heap or xmalloc. - * - * !RHASH_AR_TABLE_P(h): - * * as.st points st_table. - */ - -#define RHASH_AR_TABLE_MAX_SIZE 8 -#define RHASH_AR_TABLE_MAX_BOUND RHASH_AR_TABLE_MAX_SIZE - -typedef struct ar_table_entry { - VALUE hash; - VALUE key; - VALUE record; -} ar_table_entry; - -typedef struct ar_table_struct { - ar_table_entry entries[RHASH_AR_TABLE_MAX_SIZE]; -} ar_table; - -size_t -rb_hash_ar_table_size(void) -{ - return sizeof(ar_table); -} - static inline void copy_default(struct RHash *hash, const struct RHash *hash2) { @@ -347,10 +318,39 @@ static const struct st_hash_type identhash = { #define SET_HASH(entry, _hash) (entry)->hash = (_hash) #define SET_RECORD(entry, _value) (entry)->record = (_value) -typedef st_data_t st_hash_t; +typedef st_index_t st_hash_t; extern const st_hash_t st_reserved_hash_val; extern const st_hash_t st_reserved_hash_substitution_val; +/* + * RHASH_AR_TABLE_P(h): + * * as.ar == NULL or + * as.ar points ar_table. + * * as.ar is allocated by transient heap or xmalloc. + * + * !RHASH_AR_TABLE_P(h): + * * as.st points st_table. + */ + +#define RHASH_AR_TABLE_MAX_SIZE 8 +#define RHASH_AR_TABLE_MAX_BOUND RHASH_AR_TABLE_MAX_SIZE + +typedef struct ar_table_entry { + st_hash_t hash; + VALUE key; + VALUE record; +} ar_table_entry; + +typedef struct ar_table_struct { + ar_table_entry entries[RHASH_AR_TABLE_MAX_SIZE]; +} ar_table; + +size_t +rb_hash_ar_table_size(void) +{ + return sizeof(ar_table); +} + static inline st_hash_t do_hash(st_data_t key) { |