3 ms·
Looks like the array lookup isn't exclusive to glibc. Illumos: https://github.com/illumos/illumos-gate/blob/9ecd05bdc59e4a1091c51ce68cce2028d5ba6fd1/usr/src/li
by floxy 5y ago
Looks like the array lookup isn't exclusive to glibc.
Illumos:
https://github.com/illumos/illumos-gate/blob/9ecd05bdc59e4a1091c51ce68cce2028d5ba6fd1/usr/src/lib/libc/port/locale/isdigit.c https://github.com/illumos/illumos-gate/blob/9ecd05bdc59e4a1...
...although there is a "sensible" version at:
https://github.com/illumos/illumos-gate/blob/9ecd05bdc59e4a1091c51ce68cce2028d5ba6fd1/usr/src/uts/common/sys/ctype.h https://github.com/illumos/illumos-gate/blob/9ecd05bdc59e4a1...
FreeBSD: You have to chase it through "__sbistype" to "__sbmaskrune".
https://cgit.freebsd.org/src/tree/lib/libc/locale/isctype.c https://cgit.freebsd.org/src/tree/lib/libc/locale/isctype.c
https://cgit.freebsd.org/src/tree/include/_ctype.h https://cgit.freebsd.org/src/tree/include/_ctype.h
- moonchild 5y agoIllumos also has ridiculously huge (but sanely-behaving, thankfully) strings functions, because somebody met jump tables once and thought they were cool. https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libc/amd64/gen/memset.s https://github.com/illumos/illumos-gate/blob/master/usr/src/... e.g.
- masklinn 5y agoA table-based implementation, aside from the convenience of being declarative, is also natural if not outright necessary for locales support.