Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add iterator to handle XDG_*_DIRS #4584

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcollie
Copy link
Collaborator

@jcollie jcollie commented Jan 4, 2025

Start of implementing #4506 .

src/os/xdg.zig Outdated Show resolved Hide resolved
Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this, the API doesn't feel right.

A major issue is posix requires allocation. Posix getenv doesn't require allocation so we shouldn't force allocation for this either. Since we have to call this in the config loading path too, lowering allocation as much as possible is a win.

Bigger picture, I know I said this iterator would be helpful, but I'm not fully sure. I know I like small PRs but I'm not actually sure this is the right design. I'm not sure I could know the right design without doing it myself but I'm suspicious looking at this...

src/os/xdg.zig Outdated Show resolved Hide resolved
src/os/xdg.zig Outdated Show resolved Hide resolved
src/os/xdg.zig Outdated Show resolved Hide resolved
src/os/xdg.zig Outdated Show resolved Hide resolved
@jcollie jcollie force-pushed the xdg-config-dirs-iterator branch from c4537ff to 7107e86 Compare January 4, 2025 22:30
@jcollie jcollie force-pushed the xdg-config-dirs-iterator branch from 7107e86 to 2146de6 Compare January 4, 2025 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants