From f386f2a1fcae885967278710fe997c56e2183476 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 18 Dec 2025 23:33:26 +0000 Subject: Size-optimise a few things Saves multiple kilobytes, somehow. Unlikely to make much of a performance difference since it's mostly init/shutdown stuff. --- src/chunklets/x86.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/chunklets') diff --git a/src/chunklets/x86.c b/src/chunklets/x86.c index 012cbb0..23d52ae 100644 --- a/src/chunklets/x86.c +++ b/src/chunklets/x86.c @@ -41,6 +41,13 @@ static int mrmsib(const unsigned char *p, int addrlen) { return 1; // note: include the mrm itself in the byte count } +#ifndef X86_DISABLE_SIZE_OPT +#if defined(__clang__) +__attribute((minsize)) +#elif defined(__GNUC__) +__attribute((optimize("Os"))) +#endif +#endif int x86_len(const unsigned char *insn) { #define CASES(name, _) case name: int pfxlen = 0, addrlen = 4, operandlen = 4; -- cgit v1.2.3-54-g00ecf