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
46960936
Commit
46960936
authored
Jul 27, 2017
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `MRB_SEGMENT_SIZE` to `MRB_IV_SEGMENT_SIZE`.
parent
1e41026b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
doc/guides/mrbconf.md
doc/guides/mrbconf.md
+1
-1
src/variable.c
src/variable.c
+10
-10
No files found.
doc/guides/mrbconf.md
View file @
46960936
...
...
@@ -122,7 +122,7 @@ largest value of required alignment.
*
If defined
`Float`
will be a mruby object with
`RBasic`
.
## Instance variable configuration.
`MRB_SEGMENT_SIZE`
`MRB_
IV_
SEGMENT_SIZE`
*
Default value is
`4`
.
*
Specifies size of each segment in segment list.
...
...
src/variable.c
View file @
46960936
...
...
@@ -12,13 +12,13 @@
typedef
int
(
iv_foreach_func
)(
mrb_state
*
,
mrb_sym
,
mrb_value
,
void
*
);
#ifndef MRB_SEGMENT_SIZE
#define MRB_SEGMENT_SIZE 4
#ifndef MRB_
IV_
SEGMENT_SIZE
#define MRB_
IV_
SEGMENT_SIZE 4
#endif
typedef
struct
segment
{
mrb_sym
key
[
MRB_SEGMENT_SIZE
];
mrb_value
val
[
MRB_SEGMENT_SIZE
];
mrb_sym
key
[
MRB_
IV_
SEGMENT_SIZE
];
mrb_value
val
[
MRB_
IV_
SEGMENT_SIZE
];
struct
segment
*
next
;
}
segment
;
...
...
@@ -69,7 +69,7 @@ iv_put(mrb_state *mrb, iv_tbl *t, mrb_sym sym, mrb_value val)
size_t
i
;
while
(
seg
)
{
for
(
i
=
0
;
i
<
MRB_SEGMENT_SIZE
;
i
++
)
{
for
(
i
=
0
;
i
<
MRB_
IV_
SEGMENT_SIZE
;
i
++
)
{
mrb_sym
key
=
seg
->
key
[
i
];
/* Found room in last segment after last_len */
if
(
!
seg
->
next
&&
i
>=
t
->
last_len
)
{
...
...
@@ -134,7 +134,7 @@ iv_get(mrb_state *mrb, iv_tbl *t, mrb_sym sym, mrb_value *vp)
seg
=
t
->
rootseg
;
while
(
seg
)
{
for
(
i
=
0
;
i
<
MRB_SEGMENT_SIZE
;
i
++
)
{
for
(
i
=
0
;
i
<
MRB_
IV_
SEGMENT_SIZE
;
i
++
)
{
mrb_sym
key
=
seg
->
key
[
i
];
if
(
!
seg
->
next
&&
i
>=
t
->
last_len
)
{
...
...
@@ -169,7 +169,7 @@ iv_del(mrb_state *mrb, iv_tbl *t, mrb_sym sym, mrb_value *vp)
seg
=
t
->
rootseg
;
while
(
seg
)
{
for
(
i
=
0
;
i
<
MRB_SEGMENT_SIZE
;
i
++
)
{
for
(
i
=
0
;
i
<
MRB_
IV_
SEGMENT_SIZE
;
i
++
)
{
mrb_sym
key
=
seg
->
key
[
i
];
if
(
!
seg
->
next
&&
i
>=
t
->
last_len
)
{
...
...
@@ -196,7 +196,7 @@ iv_foreach(mrb_state *mrb, iv_tbl *t, iv_foreach_func *func, void *p)
seg
=
t
->
rootseg
;
while
(
seg
)
{
for
(
i
=
0
;
i
<
MRB_SEGMENT_SIZE
;
i
++
)
{
for
(
i
=
0
;
i
<
MRB_
IV_
SEGMENT_SIZE
;
i
++
)
{
mrb_sym
key
=
seg
->
key
[
i
];
/* no value in last segment after last_len */
...
...
@@ -232,7 +232,7 @@ iv_size(mrb_state *mrb, iv_tbl *t)
return
size
;
}
seg
=
seg
->
next
;
size
+=
MRB_SEGMENT_SIZE
;
size
+=
MRB_
IV_
SEGMENT_SIZE
;
}
/* empty iv_tbl */
return
0
;
...
...
@@ -250,7 +250,7 @@ iv_copy(mrb_state *mrb, iv_tbl *t)
t2
=
iv_new
(
mrb
);
while
(
seg
!=
NULL
)
{
for
(
i
=
0
;
i
<
MRB_SEGMENT_SIZE
;
i
++
)
{
for
(
i
=
0
;
i
<
MRB_
IV_
SEGMENT_SIZE
;
i
++
)
{
mrb_sym
key
=
seg
->
key
[
i
];
mrb_value
val
=
seg
->
val
[
i
];
...
...
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