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
b34e24b0
Commit
b34e24b0
authored
May 08, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use mrb_field_write_barrier_value() in array.c
parent
606cb68c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/array.c
src/array.c
+7
-4
No files found.
src/array.c
View file @
b34e24b0
...
...
@@ -401,7 +401,7 @@ mrb_ary_push(mrb_state *mrb, mrb_value ary, mrb_value elem)
if
(
a
->
len
==
a
->
aux
.
capa
)
ary_expand_capa
(
mrb
,
a
,
a
->
len
+
1
);
a
->
ptr
[
a
->
len
++
]
=
elem
;
mrb_
write_barrier
(
mrb
,
(
struct
RBasic
*
)
a
);
mrb_
field_write_barrier_value
(
mrb
,
(
struct
RBasic
*
)
a
,
elem
);
}
static
mrb_value
...
...
@@ -484,7 +484,7 @@ mrb_ary_unshift(mrb_state *mrb, mrb_value self, mrb_value item)
a
->
ptr
[
0
]
=
item
;
}
a
->
len
++
;
mrb_
write_barrier
(
mrb
,
(
struct
RBasic
*
)
a
);
mrb_
field_write_barrier_value
(
mrb
,
(
struct
RBasic
*
)
a
,
item
);
return
self
;
}
...
...
@@ -511,7 +511,9 @@ mrb_ary_unshift_m(mrb_state *mrb, mrb_value self)
}
array_copy
(
a
->
ptr
,
vals
,
len
);
a
->
len
+=
len
;
mrb_write_barrier
(
mrb
,
(
struct
RBasic
*
)
a
);
while
(
len
--
)
{
mrb_field_write_barrier_value
(
mrb
,
(
struct
RBasic
*
)
a
,
vals
[
len
]);
}
return
self
;
}
...
...
@@ -549,7 +551,7 @@ mrb_ary_set(mrb_state *mrb, mrb_value ary, mrb_int n, mrb_value val)
}
a
->
ptr
[
n
]
=
val
;
mrb_
write_barrier
(
mrb
,
(
struct
RBasic
*
)
a
);
mrb_
field_write_barrier_value
(
mrb
,
(
struct
RBasic
*
)
a
,
val
);
}
mrb_value
...
...
@@ -601,6 +603,7 @@ mrb_ary_splice(mrb_state *mrb, mrb_value ary, mrb_int head, mrb_int len, mrb_val
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
*
(
a
->
ptr
+
head
+
i
)
=
*
(
argv
+
i
);
mrb_field_write_barrier_value
(
mrb
,
(
struct
RBasic
*
)
a
,
argv
[
i
]);
}
a
->
len
=
size
;
...
...
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