Skip to content

Commit 32e32bd

Browse files
dlechdpgeorge
authored andcommitted
extmod/vfs: Use MP_REGISTER_ROOT_POINTER().
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>
1 parent d532c55 commit 32e32bd

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

extmod/vfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,4 +547,7 @@ int mp_vfs_mount_and_chdir_protected(mp_obj_t bdev, mp_obj_t mount_point) {
547547
return ret;
548548
}
549549

550+
MP_REGISTER_ROOT_POINTER(struct _mp_vfs_mount_t *vfs_cur);
551+
MP_REGISTER_ROOT_POINTER(struct _mp_vfs_mount_t *vfs_mount_table);
552+
550553
#endif // MICROPY_VFS

py/mpstate.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,6 @@ typedef struct _mp_state_vm_t {
198198

199199
// root pointers for extmod
200200

201-
#if MICROPY_VFS
202-
struct _mp_vfs_mount_t *vfs_cur;
203-
struct _mp_vfs_mount_t *vfs_mount_table;
204-
#endif
205-
206201
#if MICROPY_PY_BLUETOOTH
207202
mp_obj_t bluetooth;
208203
#endif

0 commit comments

Comments
 (0)