Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced some Malloc and all the alloca() calls with __PHYSFS_smallAl…
…loc(), which will stack allocate small (128 or less bytes) blocks and Malloc the rest...naturally these now have to be paired with __PHYSFS_smallFree() calls, so you can't be as lazy as a basic alloca() would let you be. The benefit is both less malloc pressure for those temporary allocations and better stack overflow safety (so if some jerk tries to push a 78 megabyte string through the library as a filename, we won't try to strcpy it to the stack).
- Loading branch information
Showing
9 changed files
with
414 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.