Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hanoi2005
redis
提交
04779bdf
R
redis
项目概览
hanoi2005
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
04779bdf
编写于
4月 07, 2012
作者:
E
Erik Dubbelboer
提交者:
antirez
9月 27, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed some spelling errors in the comments
上级
e04be06e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
16 deletion
+16
-16
src/dict.c
src/dict.c
+8
-8
src/rdb.c
src/rdb.c
+1
-1
src/t_set.c
src/t_set.c
+1
-1
src/zipmap.c
src/zipmap.c
+6
-6
未找到文件。
src/dict.c
浏览文件 @
04779bdf
...
...
@@ -116,8 +116,8 @@ unsigned int dictGenCaseHashFunction(const unsigned char *buf, int len) {
/* ----------------------------- API implementation ------------------------- */
/* Reset a
n hash
table already initialized with ht_init().
* NOTE: This function should only called by ht_destroy(). */
/* Reset a
hash
table already initialized with ht_init().
* NOTE: This function should only
be
called by ht_destroy(). */
static
void
_dictReset
(
dictht
*
ht
)
{
ht
->
table
=
NULL
;
...
...
@@ -162,18 +162,18 @@ int dictResize(dict *d)
return
dictExpand
(
d
,
minimal
);
}
/* Expand or create the hashtable */
/* Expand or create the hash
table */
int
dictExpand
(
dict
*
d
,
unsigned
long
size
)
{
dictht
n
;
/* the new hashtable */
dictht
n
;
/* the new hash
table */
unsigned
long
realsize
=
_dictNextPower
(
size
);
/* the size is invalid if it is smaller than the number of
* elements already inside the hashtable */
* elements already inside the hash
table */
if
(
dictIsRehashing
(
d
)
||
d
->
ht
[
0
].
used
>
size
)
return
DICT_ERR
;
/* Allocate the new hashtable and initialize all pointers to NULL */
/* Allocate the new hash
table and initialize all pointers to NULL */
n
.
size
=
realsize
;
n
.
sizemask
=
realsize
-
1
;
n
.
table
=
zcalloc
(
realsize
*
sizeof
(
dictEntry
*
));
...
...
@@ -280,7 +280,7 @@ int dictAdd(dict *d, void *key, void *val)
* a value returns the dictEntry structure to the user, that will make
* sure to fill the value field as he wishes.
*
* This function is also directly expoed to user API to be called
* This function is also directly expo
s
ed to user API to be called
* mainly in order to store non-pointers inside the hash value, example:
*
* entry = dictAddRaw(dict,mykey);
...
...
@@ -607,7 +607,7 @@ static int _dictKeyIndex(dict *d, const void *key)
unsigned
int
h
,
idx
,
table
;
dictEntry
*
he
;
/* Expand the hashtable if needed */
/* Expand the hash
table if needed */
if
(
_dictExpandIfNeeded
(
d
)
==
DICT_ERR
)
return
-
1
;
/* Compute the key hash value */
...
...
src/rdb.c
浏览文件 @
04779bdf
...
...
@@ -803,7 +803,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
}
/* This will also be called when the set was just converted
* to regular hashtable encoded set */
* to regular hash
table encoded set */
if
(
o
->
encoding
==
REDIS_ENCODING_HT
)
{
dictAdd
((
dict
*
)
o
->
ptr
,
ele
,
NULL
);
}
else
{
...
...
src/t_set.c
浏览文件 @
04779bdf
...
...
@@ -187,7 +187,7 @@ unsigned long setTypeSize(robj *subject) {
}
/* Convert the set to specified encoding. The resulting dict (when converting
* to a hashtable) is presized to hold the number of elements in the original
* to a hash
table) is presized to hold the number of elements in the original
* set. */
void
setTypeConvert
(
robj
*
setobj
,
int
enc
)
{
setTypeIterator
*
si
;
...
...
src/zipmap.c
浏览文件 @
04779bdf
...
...
@@ -52,15 +52,15 @@
* <len> lengths are encoded in a single value or in a 5 bytes value.
* If the first byte value (as an unsigned 8 bit value) is between 0 and
* 252, it's a single-byte length. If it is 253 then a four bytes unsigned
* integer follows (in the host byte ordering). A value
fo
255 is used to
* integer follows (in the host byte ordering). A value
of
255 is used to
* signal the end of the hash. The special value 254 is used to mark
* empty space that can be used to add new key/value pairs.
*
* <free> is the number of free unused bytes
*
after the string, resulting from modification of values associated to a
*
key (for instance if "foo" is set to "bar', and later "foo" will be se to
*
"hi", I'll have a free byte to use if the value will enlarge again later,
* or
even in or
der to add a key/value pair if it fits.
* <free> is the number of free unused bytes
after the string, resulting
*
from modification of values associated to a key. For instance if "foo"
*
is set to "bar", and later "foo" will be set to "hi", it will have a
*
free byte to use if the value will enlarge again later, or even in
* order to add a key/value pair if it fits.
*
* <free> is always an unsigned 8 bit number, because if after an
* update operation there are more than a few free bytes, the zipmap will be
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录