Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
0c0f4468
Commit
0c0f4468
authored
Jun 11, 2014
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
objfun: Remove no longer used mp_obj_fun_prepare_simple_args().
parent
f4bf065d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
py/obj.h
+0
-2
0 additions, 2 deletions
py/obj.h
py/objfun.c
+0
-43
0 additions, 43 deletions
py/objfun.c
with
0 additions
and
45 deletions
py/obj.h
+
0
−
2
View file @
0c0f4468
...
...
@@ -534,8 +534,6 @@ typedef struct _mp_obj_fun_native_t { // need this so we can define const object
// such functions won't be able to access the global scope, but that's probably okay
}
mp_obj_fun_native_t
;
bool
mp_obj_fun_prepare_simple_args
(
mp_obj_t
self_in
,
uint
n_args
,
uint
n_kw
,
const
mp_obj_t
*
args
,
uint
*
out_args1_len
,
const
mp_obj_t
**
out_args1
,
uint
*
out_args2_len
,
const
mp_obj_t
**
out_args2
);
const
char
*
mp_obj_fun_get_name
(
mp_const_obj_t
fun
);
const
char
*
mp_obj_code_get_name
(
const
byte
*
code_info
);
...
...
This diff is collapsed.
Click to expand it.
py/objfun.c
+
0
−
43
View file @
0c0f4468
...
...
@@ -193,49 +193,6 @@ STATIC NORETURN void fun_pos_args_mismatch(mp_obj_fun_bc_t *f, uint expected, ui
#endif
}
// If it's possible to call a function without allocating new argument array,
// this function returns true, together with pointers to 2 subarrays to be used
// as arguments. Otherwise, it returns false. It is expected that this function
// will be accompanied by another, mp_obj_fun_prepare_full_args(), which will
// instead take pointer to full-length out-array, and will fill it in. Rationale
// being that a caller can try this function and if it succeeds, the function call
// can be made without allocating extra memory. Otherwise, caller can allocate memory
// and try "full" function. These functions are expected to be refactoring of
// code in fun_bc_call() and eventually replace it.
bool
mp_obj_fun_prepare_simple_args
(
mp_obj_t
self_in
,
uint
n_args
,
uint
n_kw
,
const
mp_obj_t
*
args
,
uint
*
out_args1_len
,
const
mp_obj_t
**
out_args1
,
uint
*
out_args2_len
,
const
mp_obj_t
**
out_args2
)
{
mp_obj_fun_bc_t
*
self
=
self_in
;
DEBUG_printf
(
"mp_obj_fun_prepare_simple_args: given: %d pos, %d kw, expected: %d pos (%d default)
\n
"
,
n_args
,
n_kw
,
self
->
n_pos_args
,
self
->
n_def_args
);
assert
(
n_kw
==
0
);
assert
(
self
->
n_kwonly_args
==
0
);
assert
(
self
->
takes_var_args
==
0
);
assert
(
self
->
takes_kw_args
==
0
);
mp_obj_t
*
extra_args
=
self
->
extra_args
+
self
->
n_def_args
;
uint
n_extra_args
=
0
;
if
(
n_args
>
self
->
n_pos_args
)
{
goto
arg_error
;
}
else
{
if
(
n_args
>=
self
->
n_pos_args
-
self
->
n_def_args
)
{
extra_args
-=
self
->
n_pos_args
-
n_args
;
n_extra_args
+=
self
->
n_pos_args
-
n_args
;
}
else
{
fun_pos_args_mismatch
(
self
,
self
->
n_pos_args
-
self
->
n_def_args
,
n_args
);
}
}
*
out_args1
=
args
;
*
out_args1_len
=
n_args
;
*
out_args2
=
extra_args
;
*
out_args2_len
=
n_extra_args
;
return
true
;
arg_error:
fun_pos_args_mismatch
(
self
,
self
->
n_pos_args
,
n_args
);
}
// With this macro you can tune the maximum number of function state bytes
// that will be allocated on the stack. Any function that needs more
// than this will use the heap.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment