Repository navigation
core: prune dead build/config hooks, guard allocs, optimize strcasecmp - #37
Merged
Merged
Conversation
reinauer
force-pushed
the
cleanup/core-headers-and-build
branch
from
November 23, 2026 20:21
a16a680 to
4ccc917
Compare
Remove ODFS_PROFILE_FULL, ODFS_FEATURE_CACHE_BLOCK, the
ODFS_FEATURE_LOG_{SERIAL,KPRINTF,RINGBUF} flags and ODFS_PLATFORM_HOST
from config.h. Nothing in the tree tests any of them.
The ODFS_FEATURE_CHARSET_{BUILTIN,EXTERNAL} flags are not tested yet
either, but they stay: the name character set conversion will use them.
Also collapse the ODFS_PROFILE_ROM conditionals whose two arms define
the same value (ROCK_RIDGE, JOLIET, MULTISESSION, LOG), so the file
shows only the settings that really differ between the default and the
ROM profile. No behaviour change.
odfs_media_close() returns early when m->ops->close is NULL, so the second test of the same pointer right before the call is redundant.
odfs_malloc() and odfs_calloc() cast the byte count to ULONG before calling AllocVec(). AROS declares the AllocVec() size as IPTR, so on 64-bit AROS, where size_t is 64 bits, a request above 4 GiB would be truncated and could return an undersized buffer instead of NULL. Cast to IPTR on AROS. Keep the ULONG cast for AmigaOS 3 and 4, whose AllocVec()/AllocVecTags() take a ULONG, and return NULL there for a size that does not fit. On those 32-bit targets size_t is no wider than ULONG, so the check folds away at compile time.
odfs_strcasecmp() folds both bytes through odfs_ascii_tolower() before comparing them. Compare the raw bytes first and fold only a pair that differs, as meta_name_eq() in the metadata cache already does. A NUL against any other byte still differs after folding, because no character folds to NUL, so the result is unchanged. The function is used by the backends' linear directory lookups, the namefix table, the CDDA virtual file names and the virtual root map, not by the metadata cache. In a linear scan most compares already fail on the first byte, where the new order adds a compare and branch before folding; a matching name now skips folding for every byte. Being inlined at all those call sites, the shorter loop shrinks the handlers: 68000 -328 bytes, 68020 -388, OS4 CDFileSystem -272; the ROM profile grows by 12 bytes.
reinauer
force-pushed
the
cleanup/core-headers-and-build
branch
from
November 24, 2026 17:33
4ccc917 to
9a5e768
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small cleanups in shared headers, plus a 64-bit AROS allocation fix.
ODFS_PROFILE_FULL,ODFS_FEATURE_CACHE_BLOCK, theLOG_SERIAL/KPRINTF/RINGBUFflags and
ODFS_PLATFORM_HOST, none of which is tested anywhere. Alsocollapses
ODFS_PROFILE_ROMconditionals whose two arms define the samevalue. No behaviour change. The
CHARSET_BUILTIN/EXTERNALflags stay:amiga: show names in Latin-1 instead of UTF-8 #56 uses them.
odfs_media_close()testedm->ops->closetwice.AllocVec()size asIPTR, so theULONGcast truncated requests above4 GiB on 64-bit AROS. AmigaOS 3/4 keep the
ULONGcast and return NULL fora size that does not fit; that check folds away on those 32-bit targets.
same order
meta_name_eq()already uses. Results are unchanged. Thefunction is used by the backends' linear lookups, namefix, CDDA virtual
names and the virtual root map, not by the metadata cache.
The
freshsubssubmodule hook in the Makefile stays: it is there for theplanned libcodesets support.
Sizes (pinned version/date, vs the branch's base)
All of the change comes from the strcasecmp commit. The first three commits
build handlers of the same size as the base.
The branch is 94 commits behind main. On today's main the 68020 handler goes
from 81,688 to 81,452 bytes (-236).
Testing
make checkpasses on every commit.golden-check,malformed-check,fuzz-check,amiga,amiga-020,romand the OS4 build pass on the tip.CI builds the AROS x86-64 handler.
(WinUAE), AmigaOS 4.1 FE Update 3 (QEMU pegasos2) and AROS i386 (QEMU), as
they do on main.
209,019 KiB/s sequentially (main 209,007); cold discovery is 9,873
entries/s (main 9,906). The branch tip alone reads 203,736 KiB/s, which
is its old base: that measures 203,760.
built, not run).