Page MenuHomeFreeBSD

libc: Simplify __get_locale()
ClosedPublic

Authored by des on Nov 25 2025, 7:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 10, 9:06 AM
Unknown Object (File)
Tue, Dec 30, 7:22 PM
Unknown Object (File)
Mon, Dec 22, 11:38 PM
Unknown Object (File)
Mon, Dec 22, 11:11 AM
Unknown Object (File)
Dec 8 2025, 8:06 AM
Unknown Object (File)
Dec 4 2025, 12:20 AM
Unknown Object (File)
Dec 1 2025, 11:21 PM
Unknown Object (File)
Nov 30 2025, 8:41 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68842
Build 65725: arc lint + arc unit

Event Timeline

des requested review of this revision.Nov 25 2025, 7:54 PM

The only explanation I can think of for why the code was the way it was is either:

  1. It just incrementally got that way and it didn't occur to anybody to rewrite it, or
  2. It actually matters for some deep branch prediction / speculative execution magic reasons

Can anyone shed some light on this?

Note that __has_thread_locale is global while __thread_locale is thread-local.

Looks reasonable. Should do the same thing as before, literally.

lib/libc/locale/xlocale_private.h
205
This revision is now accepted and ready to land.Nov 25 2025, 8:03 PM
This revision was automatically updated to reflect the committed changes.