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
9de91914
Commit
9de91914
authored
8 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py: Move weak-link map to objmodule.c, and expose module maps as public.
parent
1864f90e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
py/builtinimport.c
+0
-8
0 additions, 8 deletions
py/builtinimport.c
py/objmodule.c
+9
-1
9 additions, 1 deletion
py/objmodule.c
py/objmodule.h
+3
-0
3 additions, 0 deletions
py/objmodule.h
with
12 additions
and
9 deletions
py/builtinimport.c
+
0
−
8
View file @
9de91914
...
...
@@ -47,14 +47,6 @@
#define PATH_SEP_CHAR '/'
#if MICROPY_MODULE_WEAK_LINKS
STATIC
const
mp_rom_map_elem_t
mp_builtin_module_weak_links_table
[]
=
{
MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS
};
STATIC
MP_DEFINE_CONST_MAP
(
mp_builtin_module_weak_links_map
,
mp_builtin_module_weak_links_table
);
#endif
bool
mp_obj_is_package
(
mp_obj_t
module
)
{
mp_obj_t
dest
[
2
];
mp_load_method_maybe
(
module
,
MP_QSTR___path__
,
dest
);
...
...
This diff is collapsed.
Click to expand it.
py/objmodule.c
+
9
−
1
View file @
9de91914
...
...
@@ -227,7 +227,15 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
MICROPY_PORT_BUILTIN_MODULES
};
STATIC
MP_DEFINE_CONST_MAP
(
mp_builtin_module_map
,
mp_builtin_module_table
);
MP_DEFINE_CONST_MAP
(
mp_builtin_module_map
,
mp_builtin_module_table
);
#if MICROPY_MODULE_WEAK_LINKS
STATIC
const
mp_rom_map_elem_t
mp_builtin_module_weak_links_table
[]
=
{
MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS
};
MP_DEFINE_CONST_MAP
(
mp_builtin_module_weak_links_map
,
mp_builtin_module_weak_links_table
);
#endif
void
mp_module_init
(
void
)
{
mp_obj_dict_init
(
&
MP_STATE_VM
(
mp_loaded_modules_dict
),
3
);
...
...
This diff is collapsed.
Click to expand it.
py/objmodule.h
+
3
−
0
View file @
9de91914
...
...
@@ -28,6 +28,9 @@
#include
"py/obj.h"
extern
const
mp_map_t
mp_builtin_module_map
;
extern
const
mp_map_t
mp_builtin_module_weak_links_map
;
void
mp_module_init
(
void
);
void
mp_module_deinit
(
void
);
mp_obj_t
mp_module_get
(
qstr
module_name
);
...
...
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