Skip to content

Commit

Permalink
Delete old wcwidth() implementation
Browse files Browse the repository at this point in the history
This shaves away 144kb of bss memory from every binary linking printf at
the expense of slightly increased binary footprint. Kudos for Byron Lai.
  • Loading branch information
jart committed Oct 14, 2023
1 parent 2db2f40 commit a657f3e
Show file tree
Hide file tree
Showing 15 changed files with 11 additions and 814 deletions.
204 changes: 0 additions & 204 deletions libc/str/kcombiningchars.S

This file was deleted.

93 changes: 0 additions & 93 deletions libc/str/keastasianwidth.S

This file was deleted.

5 changes: 0 additions & 5 deletions libc/str/str.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@ ssize_t strfmon(char *, size_t, const char *, ...);
long a64l(const char *);
char *l64a(long);

char *strntolower(char *, size_t) libcesque;
char *strtolower(char *) libcesque paramsnonnull();
char *strntoupper(char *, size_t) libcesque;
char *strtoupper(char *) libcesque paramsnonnull();

typedef unsigned mbstate_t;

wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t);
Expand Down
26 changes: 0 additions & 26 deletions libc/str/str.mk
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,6 @@ $(LIBC_STR_A_OBJS): private \
-Wframe-larger-than=4096 \
-Walloca-larger-than=4096

o/$(MODE)/libc/str/eastasianwidth.bin: \
libc/str/eastasianwidth.txt \
o/$(MODE)/tool/decode/mkwides.com
@$(COMPILE) -AMKWIDES -T$@ o/$(MODE)/tool/decode/mkwides.com -o $@ $<
o/$(MODE)/libc/str/eastasianwidth.bin.lz4: \
o/$(MODE)/libc/str/eastasianwidth.bin \
o/$(MODE)/third_party/lz4cli/lz4cli.com
@$(COMPILE) -ALZ4 -T$@ o/$(MODE)/third_party/lz4cli/lz4cli.com -q -f -9 --content-size $< $@
o/$(MODE)/libc/str/eastasianwidth.s: \
o/$(MODE)/libc/str/eastasianwidth.bin.lz4 \
o/$(MODE)/tool/build/lz4toasm.com
@$(COMPILE) -ABIN2ASM -T$@ o/$(MODE)/tool/build/lz4toasm.com -s kEastAsianWidth -o $@ $<

o/$(MODE)/libc/str/combiningchars.bin: \
libc/str/strdata.txt \
o/$(MODE)/tool/decode/mkcombos.com
@$(COMPILE) -AMKCOMBOS -T$@ o/$(MODE)/tool/decode/mkcombos.com -o $@ $<
o/$(MODE)/libc/str/combiningchars.bin.lz4: \
o/$(MODE)/libc/str/combiningchars.bin \
o/$(MODE)/third_party/lz4cli/lz4cli.com
@$(COMPILE) -ALZ4 -T$@ o/$(MODE)/third_party/lz4cli/lz4cli.com -q -f -9 --content-size $< $@
o/$(MODE)/libc/str/combiningchars.s: \
o/$(MODE)/libc/str/combiningchars.bin.lz4 \
o/$(MODE)/tool/build/lz4toasm.com
@$(COMPILE) -ABIN2ASM -T$@ o/$(MODE)/tool/build/lz4toasm.com -s kCombiningChars -o $@ $<

LIBC_STR_LIBS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)))
LIBC_STR_SRCS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)_SRCS))
LIBC_STR_HDRS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)_HDRS))
Expand Down
Loading

0 comments on commit a657f3e

Please sign in to comment.