diff options
author | Damien George <damien.p.george@gmail.com> | 2016-12-14 11:40:11 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-12-14 11:40:11 +1100 |
commit | e8f2db7da3f0e60901b09ee6eada99a9e875497f (patch) | |
tree | 1150feb2c3e6ad2669da5ac42bd862f533c768d4 /py/runtime.c | |
parent | e83f140463f2144b84e2fe4fa249ab8c8426b5e9 (diff) |
py/runtime: Zero out fs_user_mount array in mp_init.
There's no need to force ports to copy-and-paste this initialisation
code. If FSUSERMOUNT is enabled then this zeroing out must be done.
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c index 0ecccbd87..e7e35a081 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -91,6 +91,11 @@ void mp_init(void) { MP_STATE_VM(mp_module_builtins_override_dict) = NULL; #endif + #if MICROPY_FSUSERMOUNT + // zero out the pointers to the user-mounted devices + memset(MP_STATE_VM(fs_user_mount), 0, sizeof(MP_STATE_VM(fs_user_mount))); + #endif + #if MICROPY_PY_THREAD_GIL mp_thread_mutex_init(&MP_STATE_VM(gil_mutex)); #endif |