Skip to content

Commit

Permalink
extmod/vfs: Use MP_REGISTER_ROOT_POINTER().
Browse files Browse the repository at this point in the history
This uses MP_REGISTER_ROOT_POINTER() to register vfs_cur and
vfs_mount_table instead of using a conditional inside of mp_state_vm_t.

Signed-off-by: David Lechner <david@pybricks.com>
  • Loading branch information
dlech authored and dpgeorge committed Jul 18, 2022
1 parent d532c55 commit 32e32bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions extmod/vfs.c
Expand Up @@ -547,4 +547,7 @@ int mp_vfs_mount_and_chdir_protected(mp_obj_t bdev, mp_obj_t mount_point) {
return ret;
}

MP_REGISTER_ROOT_POINTER(struct _mp_vfs_mount_t *vfs_cur);
MP_REGISTER_ROOT_POINTER(struct _mp_vfs_mount_t *vfs_mount_table);

#endif // MICROPY_VFS
5 changes: 0 additions & 5 deletions py/mpstate.h
Expand Up @@ -198,11 +198,6 @@ typedef struct _mp_state_vm_t {

// root pointers for extmod

#if MICROPY_VFS
struct _mp_vfs_mount_t *vfs_cur;
struct _mp_vfs_mount_t *vfs_mount_table;
#endif

#if MICROPY_PY_BLUETOOTH
mp_obj_t bluetooth;
#endif
Expand Down

0 comments on commit 32e32bd

Please sign in to comment.