Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
65c01f60
Commit
65c01f60
authored
Aug 13, 2007
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up types for FNV hashing
git-svn-id:
file:///svn/tokudb@119
c7de825b-a66e-492c-adef-691d508d4ae1
parent
088f1153
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
newbrt/hashtable.c
newbrt/hashtable.c
+4
-4
newbrt/hashtable.h
newbrt/hashtable.h
+2
-2
No files found.
newbrt/hashtable.c
View file @
65c01f60
...
...
@@ -24,7 +24,7 @@ int toku_hashtable_create (HASHTABLE *h) {
return
0
;
}
static
void
hash_find_internal
(
HASHTABLE
tab
,
const
char
*
key
,
ITEMLEN
keylen
,
HASHELT
*
hashelt
,
HASHELT
**
prev_ptr
)
{
static
void
hash_find_internal
(
HASHTABLE
tab
,
const
unsigned
char
*
key
,
ITEMLEN
keylen
,
HASHELT
*
hashelt
,
HASHELT
**
prev_ptr
)
{
unsigned
int
h
=
hash_key
(
key
,
keylen
)
%
tab
->
arraysize
;
HASHELT
he
;
HASHELT
*
prev
=
&
tab
->
array
[
h
];
...
...
@@ -59,7 +59,7 @@ int toku_hash_rehash_everything (HASHTABLE tab, int newarraysize) {
for
(
i
=
0
;
i
<
tab
->
arraysize
;
i
++
)
{
HASHELT
he
;
while
((
he
=
tab
->
array
[
i
])
!=
0
)
{
unsigned
int
h
=
hash_key
(
he
->
key
,
he
->
keylen
)
%
newarraysize
;
unsigned
int
h
=
hash_key
(
(
unsigned
char
*
)
he
->
key
,
he
->
keylen
)
%
newarraysize
;
tab
->
array
[
i
]
=
he
->
next
;
he
->
next
=
newarray
[
h
];
newarray
[
h
]
=
he
;
...
...
@@ -73,7 +73,7 @@ int toku_hash_rehash_everything (HASHTABLE tab, int newarraysize) {
return
0
;
}
int
toku_hash_insert
(
HASHTABLE
tab
,
const
char
*
key
,
ITEMLEN
keylen
,
const
char
*
val
,
ITEMLEN
vallen
)
int
toku_hash_insert
(
HASHTABLE
tab
,
const
void
*
key
,
ITEMLEN
keylen
,
const
void
*
val
,
ITEMLEN
vallen
)
{
unsigned
int
h
=
hash_key
(
key
,
keylen
)
%
tab
->
arraysize
;
{
...
...
@@ -100,7 +100,7 @@ int toku_hash_insert (HASHTABLE tab, const char *key, ITEMLEN keylen, const char
}
}
int
toku_hash_delete
(
HASHTABLE
tab
,
const
char
*
key
,
ITEMLEN
keylen
)
{
int
toku_hash_delete
(
HASHTABLE
tab
,
const
void
*
key
,
ITEMLEN
keylen
)
{
HASHELT
he
,
*
prev_ptr
;
//printf("%s:%d deleting %s (bucket %d)\n", __FILE__, __LINE__, key, hash_key(key,keylen)%tab->arraysize);
hash_find_internal
(
tab
,
key
,
keylen
,
&
he
,
&
prev_ptr
);
...
...
newbrt/hashtable.h
View file @
65c01f60
...
...
@@ -15,10 +15,10 @@ int toku_hashtable_create (HASHTABLE*);
int
toku_hash_find
(
HASHTABLE
tab
,
bytevec
key
,
ITEMLEN
keylen
,
bytevec
*
data
,
ITEMLEN
*
datalen
);
/* Replace the key if it was already there. */
int
toku_hash_insert
(
HASHTABLE
tab
,
const
char
*
key
,
ITEMLEN
keylen
,
const
char
*
data
,
ITEMLEN
datalen
);
int
toku_hash_insert
(
HASHTABLE
tab
,
const
void
*
key
,
ITEMLEN
keylen
,
const
void
*
data
,
ITEMLEN
datalen
);
/* It is OK to delete something that isn't there. */
int
toku_hash_delete
(
HASHTABLE
tab
,
const
char
*
key
,
ITEMLEN
keylen
);
int
toku_hash_delete
(
HASHTABLE
tab
,
const
void
*
key
,
ITEMLEN
keylen
);
void
toku_hashtable_free
(
HASHTABLE
*
tab
);
int
toku_hashtable_n_entries
(
HASHTABLE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment