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
3c2f51ae
Commit
3c2f51ae
authored
Dec 05, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary keep size adjustment in stack_extend_alloc(); close #1602
parent
415ec6ac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
src/vm.c
src/vm.c
+4
-6
No files found.
src/vm.c
View file @
3c2f51ae
...
...
@@ -132,17 +132,14 @@ envadjust(mrb_state *mrb, mrb_value *oldbase, mrb_value *newbase)
/** def rec ; $deep =+ 1 ; if $deep > 1000 ; return 0 ; end ; rec ; end */
static
void
stack_extend_alloc
(
mrb_state
*
mrb
,
int
room
,
int
keep
)
stack_extend_alloc
(
mrb_state
*
mrb
,
int
room
)
{
mrb_value
*
oldbase
=
mrb
->
c
->
stbase
;
int
size
=
mrb
->
c
->
stend
-
mrb
->
c
->
stbase
;
int
off
=
mrb
->
c
->
stack
-
mrb
->
c
->
stbase
;
/* do not leave uninitialized malloc region */
if
(
keep
>
size
)
keep
=
size
;
/* Use linear stack growth.
It is slightly slower than doubling thestack space,
It is slightly slower than doubling the
stack space,
but it saves memory on small devices. */
if
(
room
<=
size
)
size
+=
MRB_STACK_GROWTH
;
...
...
@@ -164,9 +161,10 @@ static inline void
stack_extend
(
mrb_state
*
mrb
,
int
room
,
int
keep
)
{
if
(
mrb
->
c
->
stack
+
room
>=
mrb
->
c
->
stend
)
{
stack_extend_alloc
(
mrb
,
room
,
keep
);
stack_extend_alloc
(
mrb
,
room
);
}
if
(
room
>
keep
)
{
/* do not leave uninitialized malloc region */
stack_clear
(
&
(
mrb
->
c
->
stack
[
keep
]),
room
-
keep
);
}
}
...
...
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