summaryrefslogtreecommitdiff
path: root/extmod/vfs_lfsx_file.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-02-16 11:02:58 +1100
committerDamien George <damien@micropython.org>2024-02-20 10:32:55 +1100
commitcae690d047900b842beaa7798b5362b5646130af (patch)
tree69ff5f9e627bd859c0865ba8223ffe00058ffdf7 /extmod/vfs_lfsx_file.c
parent4133c0304011ff7be23f47516aac20ed54505e7a (diff)
all: Use mp_obj_malloc_with_finaliser everywhere it's applicable.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'extmod/vfs_lfsx_file.c')
-rw-r--r--extmod/vfs_lfsx_file.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/extmod/vfs_lfsx_file.c b/extmod/vfs_lfsx_file.c
index b9f332339..040585064 100644
--- a/extmod/vfs_lfsx_file.c
+++ b/extmod/vfs_lfsx_file.c
@@ -90,11 +90,10 @@ mp_obj_t MP_VFS_LFSx(file_open)(mp_obj_t self_in, mp_obj_t path_in, mp_obj_t mod
}
#if LFS_BUILD_VERSION == 1
- MP_OBJ_VFS_LFSx_FILE *o = m_new_obj_var_with_finaliser(MP_OBJ_VFS_LFSx_FILE, file_buffer, uint8_t, self->lfs.cfg->prog_size);
+ MP_OBJ_VFS_LFSx_FILE *o = mp_obj_malloc_var_with_finaliser(MP_OBJ_VFS_LFSx_FILE, uint8_t, self->lfs.cfg->prog_size, type);
#else
- MP_OBJ_VFS_LFSx_FILE *o = m_new_obj_var_with_finaliser(MP_OBJ_VFS_LFSx_FILE, file_buffer, uint8_t, self->lfs.cfg->cache_size);
+ MP_OBJ_VFS_LFSx_FILE *o = mp_obj_malloc_var_with_finaliser(MP_OBJ_VFS_LFSx_FILE, uint8_t, self->lfs.cfg->cache_size, type);
#endif
- o->base.type = type;
o->vfs = self;
#if !MICROPY_GC_CONSERVATIVE_CLEAR
memset(&o->file, 0, sizeof(o->file));