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
1fd3cc9e
Commit
1fd3cc9e
authored
Apr 08, 2017
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Apr 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3595 from keizo042/name_stack_size
Attach a name to embbeded value of rescue/ensure stack size
parents
7e285107
15b55c32
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
src/vm.c
src/vm.c
+10
-2
No files found.
src/vm.c
View file @
1fd3cc9e
...
@@ -35,6 +35,14 @@ void abort(void);
...
@@ -35,6 +35,14 @@ void abort(void);
#define STACK_INIT_SIZE 128
#define STACK_INIT_SIZE 128
#define CALLINFO_INIT_SIZE 32
#define CALLINFO_INIT_SIZE 32
#ifndef ENSURE_STACK_INIT_SIZE
#define ENSURE_STACK_INIT_SIZE 16
#endif
#ifndef RESCUE_STACK_INIT_SIZE
#define RESCUE_STACK_INIT_SIZE 16
#endif
/* Define amount of linear stack growth. */
/* Define amount of linear stack growth. */
#ifndef MRB_STACK_GROWTH
#ifndef MRB_STACK_GROWTH
#define MRB_STACK_GROWTH 128
#define MRB_STACK_GROWTH 128
...
@@ -1074,7 +1082,7 @@ RETRY_TRY_BLOCK:
...
@@ -1074,7 +1082,7 @@ RETRY_TRY_BLOCK:
CASE
(
OP_ONERR
)
{
CASE
(
OP_ONERR
)
{
/* sBx pc+=sBx on exception */
/* sBx pc+=sBx on exception */
if
(
mrb
->
c
->
rsize
<=
mrb
->
c
->
ci
->
ridx
)
{
if
(
mrb
->
c
->
rsize
<=
mrb
->
c
->
ci
->
ridx
)
{
if
(
mrb
->
c
->
rsize
==
0
)
mrb
->
c
->
rsize
=
16
;
if
(
mrb
->
c
->
rsize
==
0
)
mrb
->
c
->
rsize
=
RESCUE_STACK_INIT_SIZE
;
else
mrb
->
c
->
rsize
*=
2
;
else
mrb
->
c
->
rsize
*=
2
;
mrb
->
c
->
rescue
=
(
mrb_code
**
)
mrb_realloc
(
mrb
,
mrb
->
c
->
rescue
,
sizeof
(
mrb_code
*
)
*
mrb
->
c
->
rsize
);
mrb
->
c
->
rescue
=
(
mrb_code
**
)
mrb_realloc
(
mrb
,
mrb
->
c
->
rescue
,
sizeof
(
mrb_code
*
)
*
mrb
->
c
->
rsize
);
}
}
...
@@ -1140,7 +1148,7 @@ RETRY_TRY_BLOCK:
...
@@ -1140,7 +1148,7 @@ RETRY_TRY_BLOCK:
p
=
mrb_closure_new
(
mrb
,
irep
->
reps
[
GETARG_Bx
(
i
)]);
p
=
mrb_closure_new
(
mrb
,
irep
->
reps
[
GETARG_Bx
(
i
)]);
/* push ensure_stack */
/* push ensure_stack */
if
(
mrb
->
c
->
esize
<=
mrb
->
c
->
ci
->
eidx
+
1
)
{
if
(
mrb
->
c
->
esize
<=
mrb
->
c
->
ci
->
eidx
+
1
)
{
if
(
mrb
->
c
->
esize
==
0
)
mrb
->
c
->
esize
=
16
;
if
(
mrb
->
c
->
esize
==
0
)
mrb
->
c
->
esize
=
ENSURE_STACK_INIT_SIZE
;
else
mrb
->
c
->
esize
*=
2
;
else
mrb
->
c
->
esize
*=
2
;
mrb
->
c
->
ensure
=
(
struct
RProc
**
)
mrb_realloc
(
mrb
,
mrb
->
c
->
ensure
,
sizeof
(
struct
RProc
*
)
*
mrb
->
c
->
esize
);
mrb
->
c
->
ensure
=
(
struct
RProc
**
)
mrb_realloc
(
mrb
,
mrb
->
c
->
ensure
,
sizeof
(
struct
RProc
*
)
*
mrb
->
c
->
esize
);
}
}
...
...
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