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
73c086b4
Commit
73c086b4
authored
Jun 26, 2014
by
Patrick Pokatilo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sacrifice some micro-optimization to remove duplicate code
parent
c19f5efa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
25 deletions
+10
-25
src/vm.c
src/vm.c
+10
-25
No files found.
src/vm.c
View file @
73c086b4
...
@@ -309,36 +309,21 @@ ecall(mrb_state *mrb, int i)
...
@@ -309,36 +309,21 @@ ecall(mrb_state *mrb, int i)
mrb_value
mrb_value
mrb_funcall
(
mrb_state
*
mrb
,
mrb_value
self
,
const
char
*
name
,
mrb_int
argc
,
...)
mrb_funcall
(
mrb_state
*
mrb
,
mrb_value
self
,
const
char
*
name
,
mrb_int
argc
,
...)
{
{
mrb_value
argv
[
MRB_FUNCALL_ARGC_MAX
];
va_list
ap
;
mrb_int
i
;
mrb_sym
mid
=
mrb_intern_cstr
(
mrb
,
name
);
mrb_sym
mid
=
mrb_intern_cstr
(
mrb
,
name
);
if
(
argc
==
0
)
{
if
(
argc
>
MRB_FUNCALL_ARGC_MAX
)
{
return
mrb_funcall_argv
(
mrb
,
self
,
mid
,
0
,
0
);
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"Too long arguments. (limit="
TO_STR
(
MRB_FUNCALL_ARGC_MAX
)
")"
);
}
}
else
if
(
argc
==
1
)
{
mrb_value
v
;
va_list
ap
;
va_start
(
ap
,
argc
);
v
=
va_arg
(
ap
,
mrb_value
);
va_end
(
ap
);
return
mrb_funcall_argv
(
mrb
,
self
,
mid
,
1
,
&
v
);
}
else
{
mrb_value
argv
[
MRB_FUNCALL_ARGC_MAX
];
va_list
ap
;
mrb_int
i
;
if
(
argc
>
MRB_FUNCALL_ARGC_MAX
)
{
va_start
(
ap
,
argc
);
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"Too long arguments. (limit="
TO_STR
(
MRB_FUNCALL_ARGC_MAX
)
")"
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
}
argv
[
i
]
=
va_arg
(
ap
,
mrb_value
);
va_start
(
ap
,
argc
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
argv
[
i
]
=
va_arg
(
ap
,
mrb_value
);
}
va_end
(
ap
);
return
mrb_funcall_argv
(
mrb
,
self
,
mid
,
argc
,
argv
);
}
}
va_end
(
ap
);
return
mrb_funcall_argv
(
mrb
,
self
,
mid
,
argc
,
argv
);
}
}
mrb_value
mrb_value
...
...
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