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
725b3ca5
Commit
725b3ca5
authored
Jan 07, 2016
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move KHASH_DECLARE(ht..) to mruby/hash.h; close #3073
parent
7c82bfa7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
include/mruby/hash.h
include/mruby/hash.h
+10
-0
src/hash.c
src/hash.c
+0
-6
No files found.
include/mruby/hash.h
View file @
725b3ca5
...
...
@@ -8,6 +8,7 @@
#define MRUBY_HASH_H
#include "common.h"
#include <mruby/khash.h>
/**
* Hash class
...
...
@@ -59,6 +60,15 @@ MRB_API mrb_value mrb_hash_empty_p(mrb_state *mrb, mrb_value self);
*/
MRB_API
mrb_value
mrb_hash_clear
(
mrb_state
*
mrb
,
mrb_value
hash
);
/* declaration of struct kh_ht */
/* be careful when you touch the internal */
typedef
struct
{
mrb_value
v
;
mrb_int
n
;
}
mrb_hash_value
;
KHASH_DECLARE
(
ht
,
mrb_value
,
mrb_hash_value
,
TRUE
)
/* RHASH_TBL allocates st_table if not available. */
#define RHASH(obj) ((struct RHash*)(mrb_ptr(obj)))
#define RHASH_TBL(h) (RHASH(h)->ht)
...
...
src/hash.c
View file @
725b3ca5
...
...
@@ -91,12 +91,6 @@ mrb_hash_ht_hash_equal(mrb_state *mrb, mrb_value a, mrb_value b)
}
}
typedef
struct
{
mrb_value
v
;
mrb_int
n
;
}
mrb_hash_value
;
KHASH_DECLARE
(
ht
,
mrb_value
,
mrb_hash_value
,
TRUE
)
KHASH_DEFINE
(
ht
,
mrb_value
,
mrb_hash_value
,
TRUE
,
mrb_hash_ht_hash_func
,
mrb_hash_ht_hash_equal
)
static
void
mrb_hash_modify
(
mrb_state
*
mrb
,
mrb_value
hash
);
...
...
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