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
88eb0f54
Commit
88eb0f54
authored
Jul 24, 2013
by
fleuria
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce gc_mark_gray_list(), and cleanup redaunt code with it
parent
be419485
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
src/gc.c
src/gc.c
+16
-14
No files found.
src/gc.c
View file @
88eb0f54
...
@@ -774,6 +774,20 @@ gc_gray_mark(mrb_state *mrb, struct RBasic *obj)
...
@@ -774,6 +774,20 @@ gc_gray_mark(mrb_state *mrb, struct RBasic *obj)
return
children
;
return
children
;
}
}
static
void
gc_mark_gray_list
(
mrb_state
*
mrb
,
struct
RBasic
**
gray_list
)
{
struct
RBasic
*
obj
;
while
(
obj
=
*
gray_list
)
{
if
(
is_gray
(
obj
))
{
gc_mark_children
(
mrb
,
obj
);
}
*
gray_list
=
obj
->
gcnext
;
}
}
static
size_t
static
size_t
incremental_marking_phase
(
mrb_state
*
mrb
,
size_t
limit
)
incremental_marking_phase
(
mrb_state
*
mrb
,
size_t
limit
)
{
{
...
@@ -790,21 +804,9 @@ static void
...
@@ -790,21 +804,9 @@ static void
final_marking_phase
(
mrb_state
*
mrb
)
final_marking_phase
(
mrb_state
*
mrb
)
{
{
mark_context_stack
(
mrb
,
mrb
->
root_c
);
mark_context_stack
(
mrb
,
mrb
->
root_c
);
while
(
mrb
->
gray_list
)
{
gc_mark_gray_list
(
mrb
,
&
mrb
->
gray_list
);
if
(
is_gray
(
mrb
->
gray_list
))
gc_mark_gray_list
(
mrb
,
&
mrb
->
variable_gray_list
);
gc_mark_children
(
mrb
,
mrb
->
gray_list
);
else
mrb
->
gray_list
=
mrb
->
gray_list
->
gcnext
;
}
gc_assert
(
mrb
->
gray_list
==
NULL
);
gc_assert
(
mrb
->
gray_list
==
NULL
);
mrb
->
gray_list
=
mrb
->
variable_gray_list
;
mrb
->
variable_gray_list
=
NULL
;
while
(
mrb
->
gray_list
)
{
if
(
is_gray
(
mrb
->
gray_list
))
gc_mark_children
(
mrb
,
mrb
->
gray_list
);
else
mrb
->
gray_list
=
mrb
->
gray_list
->
gcnext
;
}
gc_assert
(
mrb
->
gray_list
==
NULL
);
gc_assert
(
mrb
->
gray_list
==
NULL
);
}
}
...
...
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