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
a851bcd6
Commit
a851bcd6
authored
Aug 21, 2012
by
Masamitsu MURASE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refer to irep_capa as well as irep_len when irep is marked by GC.
Initialize mrb->irep array with 0 when realloc is called.
parent
72bc9c8e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
src/gc.c
src/gc.c
+4
-2
src/state.c
src/state.c
+2
-0
No files found.
src/gc.c
View file @
a851bcd6
...
...
@@ -587,8 +587,10 @@ root_scan_phase(mrb_state *mrb)
mrb_gc_mark
(
mrb
,
(
struct
RBasic
*
)
ci
->
target_class
);
}
/* mark irep pool */
for
(
i
=
0
;
i
<
mrb
->
irep_len
;
i
++
)
{
if
(
mrb
->
irep
)
{
size_t
len
=
mrb
->
irep_len
;
if
(
len
>
mrb
->
irep_capa
)
len
=
mrb
->
irep_capa
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
mrb_irep
*
irep
=
mrb
->
irep
[
i
];
if
(
!
irep
)
continue
;
for
(
j
=
0
;
j
<
irep
->
plen
;
j
++
)
{
...
...
src/state.c
View file @
a851bcd6
...
...
@@ -83,10 +83,12 @@ mrb_add_irep(mrb_state *mrb, int idx)
mrb
->
irep_capa
=
max
;
}
else
if
(
mrb
->
irep_capa
<=
idx
)
{
size_t
old_capa
=
mrb
->
irep_capa
;
while
(
mrb
->
irep_capa
<=
idx
)
{
mrb
->
irep_capa
*=
2
;
}
mrb
->
irep
=
(
mrb_irep
**
)
mrb_realloc
(
mrb
,
mrb
->
irep
,
sizeof
(
mrb_irep
*
)
*
mrb
->
irep_capa
);
memset
(
mrb
->
irep
+
old_capa
,
0
,
sizeof
(
mrb_irep
*
)
*
(
mrb
->
irep_capa
-
old_capa
));
}
}
...
...
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