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
a13775eb
Commit
a13775eb
authored
Apr 29, 2014
by
kyab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add doubling stack extend, as fix for #2016
parent
d3417838
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
src/vm.c
src/vm.c
+7
-0
tasks/toolchains/visualcpp.rake
tasks/toolchains/visualcpp.rake
+2
-2
No files found.
src/vm.c
View file @
a13775eb
...
...
@@ -140,6 +140,12 @@ stack_extend_alloc(mrb_state *mrb, int room)
int
size
=
mrb
->
c
->
stend
-
mrb
->
c
->
stbase
;
int
off
=
mrb
->
c
->
stack
-
mrb
->
c
->
stbase
;
#ifdef MRB_STACK_EXTEND_DOUBLING
if
(
room
<=
size
)
size
*=
2
;
else
size
+=
room
;
#else
/* Use linear stack growth.
It is slightly slower than doubling the stack space,
but it saves memory on small devices. */
...
...
@@ -147,6 +153,7 @@ stack_extend_alloc(mrb_state *mrb, int room)
size
+=
MRB_STACK_GROWTH
;
else
size
+=
room
;
#endif
mrb
->
c
->
stbase
=
(
mrb_value
*
)
mrb_realloc
(
mrb
,
mrb
->
c
->
stbase
,
sizeof
(
mrb_value
)
*
size
);
mrb
->
c
->
stack
=
mrb
->
c
->
stbase
+
off
;
...
...
tasks/toolchains/visualcpp.rake
View file @
a13775eb
...
...
@@ -3,7 +3,7 @@ MRuby::Toolchain.new(:visualcpp) do |conf|
cc
.
command
=
ENV
[
'CC'
]
||
'cl.exe'
cc
.
flags
=
[
ENV
[
'CFLAGS'
]
||
%w(/c /nologo /W3 /Zi /MD /O2 /D_CRT_SECURE_NO_WARNINGS)
]
cc
.
include_paths
=
[
"
#{
MRUBY_ROOT
}
/include"
]
cc
.
defines
=
%w(DISABLE_GEMS)
cc
.
defines
=
%w(DISABLE_GEMS
MRB_STACK_EXTEND_DOUBLING
)
cc
.
option_include_path
=
'/I%s'
cc
.
option_define
=
'/D%s'
cc
.
compile_options
=
"%{flags} /Fo%{outfile} %{infile}"
...
...
@@ -13,7 +13,7 @@ MRuby::Toolchain.new(:visualcpp) do |conf|
cxx
.
command
=
ENV
[
'CXX'
]
||
'cl.exe'
cxx
.
flags
=
[
ENV
[
'CXXFLAGS'
]
||
ENV
[
'CFLAGS'
]
||
%w(/c /nologo /W3 /Zi /MD /O2 /EHsc /D_CRT_SECURE_NO_WARNINGS)
]
cxx
.
include_paths
=
[
"
#{
MRUBY_ROOT
}
/include"
]
cxx
.
defines
=
%w(DISABLE_GEMS)
cxx
.
defines
=
%w(DISABLE_GEMS
MRB_STACK_EXTEND_DOUBLING
)
cxx
.
option_include_path
=
'/I%s'
cxx
.
option_define
=
'/D%s'
cxx
.
compile_options
=
"%{flags} /Fo%{outfile} %{infile}"
...
...
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