зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
b2a7a289e0
Коммит
ba4672c2cb
60
hash.c
60
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)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче