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
1e41026b
Commit
1e41026b
authored
Jul 27, 2017
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always use `MRB_USE_IV_SEGLIST`.
parent
f26d00d9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
131 deletions
+0
-131
doc/guides/mrbconf.md
doc/guides/mrbconf.md
+0
-11
examples/targets/build_config_ArduinoDue.rb
examples/targets/build_config_ArduinoDue.rb
+0
-1
examples/targets/build_config_RX630.rb
examples/targets/build_config_RX630.rb
+0
-1
examples/targets/build_config_chipKITMax32.rb
examples/targets/build_config_chipKITMax32.rb
+0
-1
include/mrbconf.h
include/mrbconf.h
+0
-6
src/variable.c
src/variable.c
+0
-111
No files found.
doc/guides/mrbconf.md
View file @
1e41026b
...
...
@@ -122,20 +122,9 @@ largest value of required alignment.
*
If defined
`Float`
will be a mruby object with
`RBasic`
.
## Instance variable configuration.
`MRB_USE_IV_SEGLIST`
*
If defined enable segmented list in instance variable table instead of khash.
*
Segmented list is a linked list of key and value segments.
*
It will linear search instead of hash search.
`MRB_SEGMENT_SIZE`
*
Default value is
`4`
.
*
Specifies size of each segment in segment list.
*
Ignored when
`MRB_USE_IV_SEGLIST`
isn't defined.
`MRB_IVHASH_INIT_SIZE`
*
Default value is
`8`
.
*
Specifies initial size for instance variable table.
*
Ignored when
`MRB_USE_IV_SEGLIST`
is defined.
## Other configuration.
`MRB_UTF8_STRING`
...
...
examples/targets/build_config_ArduinoDue.rb
View file @
1e41026b
...
...
@@ -46,7 +46,6 @@ MRuby::CrossBuild.new("ArduinoDue") do |conf|
#configuration for low memory environment
cc
.
defines
<<
%w(MRB_HEAP_PAGE_SIZE=64)
cc
.
defines
<<
%w(MRB_USE_IV_SEGLIST)
cc
.
defines
<<
%w(KHASH_DEFAULT_SIZE=8)
cc
.
defines
<<
%w(MRB_STR_BUF_MIN_SIZE=20)
cc
.
defines
<<
%w(MRB_GC_STRESS)
...
...
examples/targets/build_config_RX630.rb
View file @
1e41026b
...
...
@@ -32,7 +32,6 @@ MRuby::CrossBuild.new("RX630") do |conf|
#configuration for low memory environment
cc
.
defines
<<
%w(MRB_USE_FLOAT)
cc
.
defines
<<
%w(MRB_HEAP_PAGE_SIZE=64)
cc
.
defines
<<
%w(MRB_USE_IV_SEGLIST)
cc
.
defines
<<
%w(KHASH_DEFAULT_SIZE=8)
cc
.
defines
<<
%w(MRB_STR_BUF_MIN_SIZE=20)
cc
.
defines
<<
%w(MRB_GC_STRESS)
...
...
examples/targets/build_config_chipKITMax32.rb
View file @
1e41026b
...
...
@@ -43,7 +43,6 @@ MRuby::CrossBuild.new("chipKITMax32") do |conf|
#configuration for low memory environment
cc
.
defines
<<
%w(MRB_HEAP_PAGE_SIZE=64)
cc
.
defines
<<
%w(MRB_USE_IV_SEGLIST)
cc
.
defines
<<
%w(KHASH_DEFAULT_SIZE=8)
cc
.
defines
<<
%w(MRB_STR_BUF_MIN_SIZE=20)
cc
.
defines
<<
%w(MRB_GC_STRESS)
...
...
include/mrbconf.h
View file @
1e41026b
...
...
@@ -52,12 +52,6 @@
/* number of object per heap page */
//#define MRB_HEAP_PAGE_SIZE 1024
/* use segmented list for IV table */
//#define MRB_USE_IV_SEGLIST
/* initial size for IV khash; ignored when MRB_USE_IV_SEGLIST is set */
//#define MRB_IVHASH_INIT_SIZE 8
/* if _etext and _edata available, mruby can reduce memory used by symbols */
//#define MRB_USE_ETEXT_EDATA
...
...
src/variable.c
View file @
1e41026b
...
...
@@ -12,8 +12,6 @@
typedef
int
(
iv_foreach_func
)(
mrb_state
*
,
mrb_sym
,
mrb_value
,
void
*
);
#ifdef MRB_USE_IV_SEGLIST
#ifndef MRB_SEGMENT_SIZE
#define MRB_SEGMENT_SIZE 4
#endif
...
...
@@ -280,115 +278,6 @@ iv_free(mrb_state *mrb, iv_tbl *t)
mrb_free
(
mrb
,
t
);
}
#else
#include <mruby/khash.h>
#ifndef MRB_IVHASH_INIT_SIZE
#define MRB_IVHASH_INIT_SIZE 8
#endif
KHASH_DECLARE
(
iv
,
mrb_sym
,
mrb_value
,
TRUE
)
KHASH_DEFINE
(
iv
,
mrb_sym
,
mrb_value
,
TRUE
,
kh_int_hash_func
,
kh_int_hash_equal
)
typedef
struct
iv_tbl
{
khash_t
(
iv
)
h
;
}
iv_tbl
;
static
iv_tbl
*
iv_new
(
mrb_state
*
mrb
)
{
return
(
iv_tbl
*
)
kh_init_size
(
iv
,
mrb
,
MRB_IVHASH_INIT_SIZE
);
}
static
void
iv_put
(
mrb_state
*
mrb
,
iv_tbl
*
t
,
mrb_sym
sym
,
mrb_value
val
)
{
khash_t
(
iv
)
*
h
=
&
t
->
h
;
khiter_t
k
;
k
=
kh_put
(
iv
,
mrb
,
h
,
sym
);
kh_value
(
h
,
k
)
=
val
;
}
static
mrb_bool
iv_get
(
mrb_state
*
mrb
,
iv_tbl
*
t
,
mrb_sym
sym
,
mrb_value
*
vp
)
{
khash_t
(
iv
)
*
h
=
&
t
->
h
;
khiter_t
k
;
k
=
kh_get
(
iv
,
mrb
,
h
,
sym
);
if
(
k
!=
kh_end
(
h
))
{
if
(
vp
)
*
vp
=
kh_value
(
h
,
k
);
return
TRUE
;
}
return
FALSE
;
}
static
mrb_bool
iv_del
(
mrb_state
*
mrb
,
iv_tbl
*
t
,
mrb_sym
sym
,
mrb_value
*
vp
)
{
khash_t
(
iv
)
*
h
=
&
t
->
h
;
khiter_t
k
;
if
(
h
)
{
k
=
kh_get
(
iv
,
mrb
,
h
,
sym
);
if
(
k
!=
kh_end
(
h
))
{
mrb_value
val
=
kh_value
(
h
,
k
);
kh_del
(
iv
,
mrb
,
h
,
k
);
if
(
vp
)
*
vp
=
val
;
return
TRUE
;
}
}
return
FALSE
;
}
static
mrb_bool
iv_foreach
(
mrb_state
*
mrb
,
iv_tbl
*
t
,
iv_foreach_func
*
func
,
void
*
p
)
{
khash_t
(
iv
)
*
h
=
&
t
->
h
;
khiter_t
k
;
int
n
;
if
(
h
)
{
for
(
k
=
kh_begin
(
h
);
k
!=
kh_end
(
h
);
k
++
)
{
if
(
kh_exist
(
h
,
k
))
{
n
=
(
*
func
)(
mrb
,
kh_key
(
h
,
k
),
kh_value
(
h
,
k
),
p
);
if
(
n
>
0
)
return
FALSE
;
if
(
n
<
0
)
{
kh_del
(
iv
,
mrb
,
h
,
k
);
}
}
}
}
return
TRUE
;
}
static
size_t
iv_size
(
mrb_state
*
mrb
,
iv_tbl
*
t
)
{
khash_t
(
iv
)
*
h
;
if
(
t
&&
(
h
=
&
t
->
h
))
{
return
kh_size
(
h
);
}
return
0
;
}
static
iv_tbl
*
iv_copy
(
mrb_state
*
mrb
,
iv_tbl
*
t
)
{
return
(
iv_tbl
*
)
kh_copy
(
iv
,
mrb
,
&
t
->
h
);
}
static
void
iv_free
(
mrb_state
*
mrb
,
iv_tbl
*
t
)
{
kh_destroy
(
iv
,
mrb
,
&
t
->
h
);
}
#endif
static
int
iv_mark_i
(
mrb_state
*
mrb
,
mrb_sym
sym
,
mrb_value
v
,
void
*
p
)
{
...
...
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