Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
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
Libraries
mruby
Commits
364e6b5a
Commit
364e6b5a
authored
Jun 01, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
symbol table key should be mrb_sym, not int32_t
parent
8180fee1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
include/mruby/khash.h
include/mruby/khash.h
+2
-3
src/symbol.c
src/symbol.c
+1
-1
No files found.
include/mruby/khash.h
View file @
364e6b5a
...
@@ -190,10 +190,9 @@ static const uint8_t __m[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
...
@@ -190,10 +190,9 @@ static const uint8_t __m[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
#define kh_size(h) ((h)->size)
#define kh_size(h) ((h)->size)
#define kh_n_buckets(h) ((h)->n_buckets)
#define kh_n_buckets(h) ((h)->n_buckets)
//#define kh_int_hash_func(mrb,key) (uint32_t)(key)
#define kh_int_hash_func(mrb,key) (khint_t)((key)^((key)<<2)^((key)>>2))
#define kh_int_hash_func(mrb,key) (uint32_t)((key)^((key)<<2)^((key)>>2))
#define kh_int_hash_equal(mrb,a, b) (a == b)
#define kh_int_hash_equal(mrb,a, b) (a == b)
#define kh_int64_hash_func(mrb,key) (
uint32
_t)((key)>>33^(key)^(key)<<11)
#define kh_int64_hash_func(mrb,key) (
khint
_t)((key)>>33^(key)^(key)<<11)
#define kh_int64_hash_equal(mrb,a, b) (a == b)
#define kh_int64_hash_equal(mrb,a, b) (a == b)
static
inline
khint_t
__ac_X31_hash_string
(
const
char
*
s
)
static
inline
khint_t
__ac_X31_hash_string
(
const
char
*
s
)
{
{
...
...
src/symbol.c
View file @
364e6b5a
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
#include <stdio.h>
#include <stdio.h>
/* ------------------------------------------------------ */
/* ------------------------------------------------------ */
KHASH_
MAP_INIT_INT
(
s2n
,
const
char
*
);
KHASH_
INIT
(
s2n
,
mrb_sym
,
const
char
*
,
1
,
kh_int_hash_func
,
kh_int_hash_equal
)
KHASH_MAP_INIT_STR
(
n2s
,
mrb_sym
);
KHASH_MAP_INIT_STR
(
n2s
,
mrb_sym
);
/* ------------------------------------------------------ */
/* ------------------------------------------------------ */
mrb_sym
mrb_sym
...
...
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