From ba4672c2cb90c85bfeb7cac3295c68b116c7c6f5 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 4 Jan 2019 01:59:49 +0000 Subject: [PATCH] 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 --- hash.c | 60 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/hash.c b/hash.c index 870511a577..3cd4776a17 100644 --- a/hash.c +++ b/hash.c @@ -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) {