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
d22b72a7
Unverified
Commit
d22b72a7
authored
Apr 01, 2020
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Apr 01, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4957 from dearblue/excessive-arena
Fix `mrb_funcall_with_block()` uses more GC arena
parents
5acd802d
15dec838
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
src/vm.c
src/vm.c
+2
-3
No files found.
src/vm.c
View file @
d22b72a7
...
...
@@ -430,6 +430,7 @@ MRB_API mrb_value
mrb_funcall_with_block
(
mrb_state
*
mrb
,
mrb_value
self
,
mrb_sym
mid
,
mrb_int
argc
,
const
mrb_value
*
argv
,
mrb_value
blk
)
{
mrb_value
val
;
int
ai
=
mrb_gc_arena_save
(
mrb
);
if
(
!
mrb
->
jmp
)
{
struct
mrb_jmpbuf
c_jmp
;
...
...
@@ -518,19 +519,17 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc
mrb
->
c
->
stack
[
argc
+
1
]
=
blk
;
if
(
MRB_METHOD_CFUNC_P
(
m
))
{
int
ai
=
mrb_gc_arena_save
(
mrb
);
ci
->
acc
=
CI_ACC_DIRECT
;
val
=
MRB_METHOD_CFUNC
(
m
)(
mrb
,
self
);
mrb
->
c
->
stack
=
mrb
->
c
->
ci
->
stackent
;
cipop
(
mrb
);
mrb_gc_arena_restore
(
mrb
,
ai
);
}
else
{
ci
->
acc
=
CI_ACC_SKIP
;
val
=
mrb_run
(
mrb
,
MRB_METHOD_PROC
(
m
),
self
);
}
}
mrb_gc_arena_restore
(
mrb
,
ai
);
mrb_gc_protect
(
mrb
,
val
);
return
val
;
}
...
...
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