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
0f7cd2e3
Commit
0f7cd2e3
authored
Mar 13, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1002 from monaka/pr-extract-stack-zero-filling
Extract stack zero filling into new function.
parents
9c640a08
68468dab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
src/vm.c
src/vm.c
+16
-9
No files found.
src/vm.c
View file @
0f7cd2e3
...
...
@@ -55,12 +55,20 @@ The value below allows about 60000 recursive calls in the simplest case. */
#endif
static
inline
void
stack_c
opy
(
mrb_value
*
dst
,
const
mrb_value
*
src
,
size_t
size
)
stack_c
lear
(
mrb_value
*
from
,
size_t
count
)
{
size_t
i
;
const
mrb_value
mrb_value_zero
=
{
{
0
}
};
while
(
count
--
>
0
)
{
*
from
++
=
mrb_value_zero
;
}
}
for
(
i
=
0
;
i
<
size
;
i
++
)
{
dst
[
i
]
=
src
[
i
];
static
inline
void
stack_copy
(
mrb_value
*
dst
,
const
mrb_value
*
src
,
size_t
size
)
{
while
(
size
--
>
0
)
{
*
dst
++
=
*
src
++
;
}
}
...
...
@@ -130,15 +138,14 @@ stack_extend(mrb_state *mrb, int room, int keep)
}
if
(
room
>
keep
)
{
int
i
;
for
(
i
=
keep
;
i
<
room
;
i
++
)
{
#ifndef MRB_NAN_BOXING
static
const
mrb_value
mrb_value_zero
=
{
{
0
}
};
mrb
->
stack
[
i
]
=
mrb_value_zero
;
stack_clear
(
&
(
mrb
->
stack
[
keep
]),
room
-
keep
);
#else
int
i
;
for
(
i
=
keep
;
i
<
room
;
i
++
)
{
SET_NIL_VALUE
(
mrb
->
stack
[
i
]);
#endif
}
#endif
}
}
...
...
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