Skip to content

LayeredFS: Call UnMountArchive before Mount#2200

Merged
TuxSH merged 2 commits intoLumaTeam:masterfrom
R-YaTian:lfs_fix
Dec 12, 2025
Merged

LayeredFS: Call UnMountArchive before Mount#2200
TuxSH merged 2 commits intoLumaTeam:masterfrom
R-YaTian:lfs_fix

Conversation

@R-YaTian
Copy link
Copy Markdown
Contributor

@R-YaTian R-YaTian commented Dec 5, 2025

This prevents the archive handle from remaining unreleased after used, which could otherwise lead to memory overflows in certain situations. See also: 3ds-battery-patches#4
Additionally, the MAKE_BRANCH_LINK macro is now used to generate BL jump instructions to fsMountArchive, fsUnMountArchive, and fsRegisterArchive. This saves a few bytes in the LFS patch code, preventing issues where the replacement of the throwFatalError function could exceed the original function size. The original LFS patch code used the BLX instruction, this is unnecessary because none of the three functions require switching to THUMB mode.
Edit: This PR also fix #1954.

@TuxSH TuxSH merged commit 4cfca3c into LumaTeam:master Dec 12, 2025
@TuxSH
Copy link
Copy Markdown
Member

TuxSH commented Dec 12, 2025

Merged, thanks.

Nit: "UnMount" should have been "Unmount"

@R-YaTian R-YaTian deleted the lfs_fix branch December 13, 2025 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Random crashes with custom homemenu

3 participants