-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
py/stream.c: Implemented truncate(). #11500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: David Grayson <davidegrayson@gmail.com>
Code size report:
|
Thanks for the contribution. As you can see above from the code size report, it's quite a large increase in code size. More than I would have expected since the change is not that large. Do you think there's any way to optimise further for size? |
The majority of the code size change is due to the firmware now including file truncation library routines for FAT and LFS which were previously garbage-collected by the linker as unused functions. Here are the results of some experiments where I measured the size of the RP2 port firmware with FAT and MSC enabled. For the third row, I added
So 67% of the code space increase comes from those library routines. I think truncate support should be an optional feature, and by default only be enabled if Perhaps the code size could be improved a little by changing By the way, this PR currently uses f_lseek to expand a FAT file, and it seems like that results in unspecified bytes being added to the end of the file. If we improve |
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
This fixes issue #4775.