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
7f983928
Unverified
Commit
7f983928
authored
7 years ago
by
ksss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce object allocation
parent
be5c304b
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
mrbgems/mruby-proc-ext/src/proc.c
mrbgems/mruby-proc-ext/src/proc.c
+3
-2
No files found.
mrbgems/mruby-proc-ext/src/proc.c
View file @
7f983928
...
...
@@ -110,7 +110,7 @@ mrb_proc_parameters(mrb_state *mrb, mrb_value self)
const
struct
RProc
*
proc
=
mrb_proc_ptr
(
self
);
const
struct
mrb_irep
*
irep
=
proc
->
body
.
irep
;
mrb_aspec
aspec
;
mrb_value
parameters
;
mrb_value
sname
,
parameters
;
int
i
,
j
;
if
(
MRB_PROC_CFUNC_P
(
proc
))
{
...
...
@@ -142,7 +142,8 @@ mrb_proc_parameters(mrb_state *mrb, mrb_value self)
parameters
=
mrb_ary_new_capa
(
mrb
,
irep
->
nlocals
-
1
);
for
(
i
=
0
,
p
=
parameters_list
;
p
->
name
;
p
++
)
{
mrb_value
sname
=
mrb_symbol_value
(
mrb_intern_cstr
(
mrb
,
p
->
name
));
if
(
p
->
size
<=
0
)
continue
;
sname
=
mrb_symbol_value
(
mrb_intern_cstr
(
mrb
,
p
->
name
));
for
(
j
=
0
;
j
<
p
->
size
;
i
++
,
j
++
)
{
mrb_value
a
=
mrb_ary_new
(
mrb
);
mrb_ary_push
(
mrb
,
a
,
sname
);
...
...
This diff is collapsed.
Click to expand it.
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