Page MenuHomeFreeBSD

libc: Simplify __get_locale()
ClosedPublic

Authored by des on Nov 25 2025, 7:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Aug 19, 7:41 PM
Unknown Object (File)
Thu, Aug 13, 12:17 AM
Unknown Object (File)
Wed, Aug 12, 1:46 AM
Unknown Object (File)
Tue, Aug 11, 12:05 AM
Unknown Object (File)
Mon, Aug 10, 6:59 PM
Unknown Object (File)
Mon, Aug 10, 6:42 PM
Unknown Object (File)
Mon, Aug 10, 12:45 PM
Unknown Object (File)
Sun, Aug 9, 8:53 PM
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.