[all-commits] [llvm/llvm-project] 7252ed: [libc] Support dynamically-grown lines in FlatFile...

Jeff Bailey via All-commits all-commits at lists.llvm.org
Wed Sep 16 12:42:04 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7252edd9aa82ef1c570ff6694ef7f4763a8a5d2f
      https://github.com/llvm/llvm-project/commit/7252edd9aa82ef1c570ff6694ef7f4763a8a5d2f
  Author: Jeff Bailey <jbailey at raspberryginger.com>
  Date:   2026-09-16 (Wed, 16 Sep 2026)

  Changed paths:
    M libc/src/__support/pwd/CMakeLists.txt
    A libc/src/__support/pwd/dynamic_buffer.h
    M libc/src/__support/pwd/flat_file_db.h
    M libc/src/pwd/pwd_utils.cpp
    M libc/src/pwd/pwd_utils.h
    M libc/test/src/__support/pwd/CMakeLists.txt
    M libc/test/src/__support/pwd/flat_file_db_test.cpp

  Log Message:
  -----------
  [libc] Support dynamically-grown lines in FlatFileDatabase (#223811)

Add pwd::DynamicBuffer and overloads of FlatFileDatabase::getnext and
lookup that read into a growable buffer rather than a fixed span.
parse_line now returns ErrorOr<void> and accepts the buffer and line
length so parsers can report ERANGE or EINVAL directly.

Fixed-buffer getnext keeps its signature and never allocates.
Fixed-buffer lookup skips unrelated oversized preceding records using a
temporary ScopedDynamicBuffer and reports ERANGE only when the matched
record does not fit in the caller's buffer.

DynamicBuffer is trivially destructible by design so that it can be a
constant-initialised process global. Storage is released explicitly by
whoever owns it.

* Add pwd::DynamicBuffer in src/__support/pwd/dynamic_buffer.h
* Add growable overloads to FlatFileDatabase
* Update parse_line<struct passwd> signature
* Add unit tests for dynamically-grown lines in FlatFileDatabase

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