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
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
7bc71f54
Commit
7bc71f54
authored
6 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py/objfun: Make fun_data arg of mp_obj_new_fun_asm() a const pointer.
parent
bf352047
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
py/obj.h
+1
-1
1 addition, 1 deletion
py/obj.h
py/objfun.c
+3
-3
3 additions, 3 deletions
py/objfun.c
with
4 additions
and
4 deletions
py/obj.h
+
1
−
1
View file @
7bc71f54
...
...
@@ -649,7 +649,7 @@ mp_obj_t mp_obj_new_exception_msg(const mp_obj_type_t *exc_type, const char *msg
mp_obj_t
mp_obj_new_exception_msg_varg
(
const
mp_obj_type_t
*
exc_type
,
const
char
*
fmt
,
...);
// counts args by number of % symbols in fmt, excluding %%; can only handle void* sizes (ie no float/double!)
mp_obj_t
mp_obj_new_fun_bc
(
mp_obj_t
def_args
,
mp_obj_t
def_kw_args
,
const
byte
*
code
,
const
mp_uint_t
*
const_table
);
mp_obj_t
mp_obj_new_fun_native
(
mp_obj_t
def_args_in
,
mp_obj_t
def_kw_args
,
const
void
*
fun_data
,
const
mp_uint_t
*
const_table
);
mp_obj_t
mp_obj_new_fun_asm
(
size_t
n_args
,
void
*
fun_data
,
mp_uint_t
type_sig
);
mp_obj_t
mp_obj_new_fun_asm
(
size_t
n_args
,
const
void
*
fun_data
,
mp_uint_t
type_sig
);
mp_obj_t
mp_obj_new_gen_wrap
(
mp_obj_t
fun
);
mp_obj_t
mp_obj_new_closure
(
mp_obj_t
fun
,
size_t
n_closed
,
const
mp_obj_t
*
closed
);
mp_obj_t
mp_obj_new_tuple
(
size_t
n
,
const
mp_obj_t
*
items
);
...
...
This diff is collapsed.
Click to expand it.
py/objfun.c
+
3
−
3
View file @
7bc71f54
...
...
@@ -429,7 +429,7 @@ mp_obj_t mp_obj_new_fun_native(mp_obj_t def_args_in, mp_obj_t def_kw_args, const
typedef
struct
_mp_obj_fun_asm_t
{
mp_obj_base_t
base
;
size_t
n_args
;
void
*
fun_data
;
// GC must be able to trace this pointer
const
void
*
fun_data
;
// GC must be able to trace this pointer
mp_uint_t
type_sig
;
}
mp_obj_fun_asm_t
;
...
...
@@ -488,7 +488,7 @@ STATIC mp_obj_t fun_asm_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const
mp_arg_check_num
(
n_args
,
n_kw
,
self
->
n_args
,
self
->
n_args
,
false
);
void
*
fun
=
MICROPY_MAKE_POINTER_CALLABLE
(
self
->
fun_data
);
const
void
*
fun
=
MICROPY_MAKE_POINTER_CALLABLE
(
self
->
fun_data
);
mp_uint_t
ret
;
if
(
n_args
==
0
)
{
...
...
@@ -520,7 +520,7 @@ STATIC const mp_obj_type_t mp_type_fun_asm = {
.
unary_op
=
mp_generic_unary_op
,
};
mp_obj_t
mp_obj_new_fun_asm
(
size_t
n_args
,
void
*
fun_data
,
mp_uint_t
type_sig
)
{
mp_obj_t
mp_obj_new_fun_asm
(
size_t
n_args
,
const
void
*
fun_data
,
mp_uint_t
type_sig
)
{
mp_obj_fun_asm_t
*
o
=
m_new_obj
(
mp_obj_fun_asm_t
);
o
->
base
.
type
=
&
mp_type_fun_asm
;
o
->
n_args
=
n_args
;
...
...
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