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
5fb8fa5a
Commit
5fb8fa5a
authored
Mar 01, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add _FLAG to SET_SHARED macros; ref #1750
parent
fca90a43
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/array.c
src/array.c
+5
-5
No files found.
src/array.c
View file @
5fb8fa5a
...
...
@@ -16,8 +16,8 @@
#define ARY_C_MAX_SIZE (SIZE_MAX / sizeof(mrb_value))
#define ARY_MAX_SIZE ((ARY_C_MAX_SIZE < (size_t)MRB_INT_MAX) ? (mrb_int)ARY_C_MAX_SIZE : MRB_INT_MAX-1)
#define ARY_SHARED_P(a) ((a)->flags & MRB_ARY_SHARED)
#define ARY_SET_SHARED(a) ((a)->flags |= MRB_ARY_SHARED)
#define ARY_UNSET_SHARED(a) ((a)->flags &= ~MRB_ARY_SHARED)
#define ARY_SET_SHARED
_FLAG
(a) ((a)->flags |= MRB_ARY_SHARED)
#define ARY_UNSET_SHARED
_FLAG
(a) ((a)->flags &= ~MRB_ARY_SHARED)
static
inline
mrb_value
ary_elt
(
mrb_value
ary
,
mrb_int
offset
)
...
...
@@ -149,7 +149,7 @@ ary_modify(mrb_state *mrb, struct RArray *a)
a
->
aux
.
capa
=
a
->
len
;
mrb_ary_decref
(
mrb
,
shared
);
}
ARY_UNSET_SHARED
(
a
);
ARY_UNSET_SHARED
_FLAG
(
a
);
}
}
...
...
@@ -175,7 +175,7 @@ ary_make_shared(mrb_state *mrb, struct RArray *a)
}
shared
->
len
=
a
->
len
;
a
->
aux
.
shared
=
shared
;
ARY_SET_SHARED
(
a
);
ARY_SET_SHARED
_FLAG
(
a
);
}
}
...
...
@@ -671,7 +671,7 @@ ary_subseq(mrb_state *mrb, struct RArray *a, mrb_int beg, mrb_int len)
b
->
len
=
len
;
b
->
aux
.
shared
=
a
->
aux
.
shared
;
b
->
aux
.
shared
->
refcnt
++
;
ARY_SET_SHARED
(
b
);
ARY_SET_SHARED
_FLAG
(
b
);
return
mrb_obj_value
(
b
);
}
...
...
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