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
91ba9ba7
Commit
91ba9ba7
authored
May 13, 2015
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2786 from furunkel/set_value
Avoid unnecessary stores and reloads
parents
06287783
99a00cf4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
include/mruby/boxing_nan.h
include/mruby/boxing_nan.h
+1
-1
include/mruby/boxing_word.h
include/mruby/boxing_word.h
+3
-5
No files found.
include/mruby/boxing_nan.h
View file @
91ba9ba7
...
...
@@ -61,7 +61,6 @@ typedef struct mrb_value {
#define mrb_symbol(o) (o).value.sym
#define BOXNAN_SET_VALUE(o, tt, attr, v) do {\
(o).value.ttt = (0xfff00000|(((tt)+1)<<14));\
switch (tt) {\
case MRB_TT_FALSE:\
case MRB_TT_TRUE:\
...
...
@@ -70,6 +69,7 @@ typedef struct mrb_value {
case MRB_TT_SYMBOL: (o).attr = (v); break;\
default: (o).value.i = 0; (o).value.p = (void*)((uintptr_t)(o).value.p | (((uintptr_t)(v))>>2)); break;\
}\
(o).value.ttt = (0xfff00000|(((tt)+1)<<14));\
} while (0)
#define SET_FLOAT_VALUE(mrb,r,v) do { \
...
...
include/mruby/boxing_word.h
View file @
91ba9ba7
...
...
@@ -92,15 +92,13 @@ mrb_type(mrb_value o)
#define mrb_nil_p(o) ((o).w == MRB_Qnil)
#define BOXWORD_SET_VALUE(o, ttt, attr, v) do {\
(o).w = 0;\
(o).attr = (v);\
switch (ttt) {\
case MRB_TT_FALSE: (o).w = (v) ? MRB_Qfalse : MRB_Qnil; break;\
case MRB_TT_TRUE: (o).w = MRB_Qtrue; break;\
case MRB_TT_UNDEF: (o).w = MRB_Qundef; break;\
case MRB_TT_FIXNUM: (o).value.i_flag = MRB_FIXNUM_FLAG; break;\
case MRB_TT_SYMBOL: (o).value.sym_flag = MRB_SYMBOL_FLAG; break;\
default: if ((o).value.bp) (o).value.bp->tt = ttt; break;\
case MRB_TT_FIXNUM: (o).value.i_flag = MRB_FIXNUM_FLAG;
(o).attr = (v);
break;\
case MRB_TT_SYMBOL: (o).value.sym_flag = MRB_SYMBOL_FLAG;
(o).attr = (v);
break;\
default:
(o).w = 0; (o).attr = (v);
if ((o).value.bp) (o).value.bp->tt = ttt; break;\
}\
} while (0)
...
...
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