[all-commits] [llvm/llvm-project] ce4cef: [libc][stdlib] Add EnvironmentManager (#195260)

Jeff Bailey via All-commits all-commits at lists.llvm.org
Wed May 6 12:00:29 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ce4cef8d3a10acdcaba55463c68297c22c645a30
      https://github.com/llvm/llvm-project/commit/ce4cef8d3a10acdcaba55463c68297c22c645a30
  Author: Jeff Bailey <jbailey at raspberryginger.com>
  Date:   2026-05-06 (Wed, 06 May 2026)

  Changed paths:
    M libc/src/stdlib/CMakeLists.txt
    A libc/src/stdlib/environ_internal.cpp
    A libc/src/stdlib/environ_internal.h
    M libc/src/stdlib/getenv.cpp

  Log Message:
  -----------
  [libc][stdlib] Add EnvironmentManager (#195260)

Introduced an EnvironmentManager singleton that centralises environment
variable state: the environ array, per-string ownership tracking, and
capacity management. The manager exposes a minimal public API (get,
begin/end iterators) and keeps all internal state private.

Refactored getenv to delegate to EnvironmentManager::get() rather than
directly iterating app.env_ptr.

The ownership tracking and capacity management are preparatory
infrastructure for setenv.

Assisted-by: Automated tooling, human reviewed.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list