Skip to content

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Nov 1, 2025

Motivation

It is better to avoid null termination for performance and memory
safety, wherever possible.

Context

These are good cleanups extracted from the Pascal String work (#14442) that we can land by themselves first, shrinking the diff in that PR.

Co-Authored-By: @glittershark

depends on #14443


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@Ericson2314 Ericson2314 requested a review from edolstra as a code owner November 1, 2025 20:57
@github-actions github-actions bot added new-cli Relating to the "nix" command c api Nix as a C library with a stable interface labels Nov 1, 2025
@Ericson2314 Ericson2314 requested review from Radvendii, edolstra and xokdvium and removed request for edolstra November 1, 2025 20:58
@Ericson2314
Copy link
Member Author

Cool PR number :)

@dpulls
Copy link

dpulls bot commented Nov 1, 2025

🎉 All dependencies have been resolved !

It is better to avoid null termination for performance and memory
safety, wherever possible.

These are good cleanups extracted from the Pascal String work that we
can land by themselves first, shrinking the diff in that PR.

Co-Authored-By: Aspen Smith <[email protected]>
Co-Authored-By: Sergei Zimmerman <[email protected]>
@Ericson2314
Copy link
Member Author

@xokdvium otherwise looks good?

@xokdvium
Copy link
Contributor

xokdvium commented Nov 3, 2025

Yeah. I got rid of the bit_casts so this should be good to go

@xokdvium
Copy link
Contributor

xokdvium commented Nov 3, 2025

This does mean that we are doing a bit more implicit strlens, but I couldn't measure an appreciable difference.

@Ericson2314
Copy link
Member Author

Yes yeah it is very slight performance degradation (until we do the next PR). Not surprised it was non-measurable.

@Ericson2314 Ericson2314 added this pull request to the merge queue Nov 3, 2025
Merged via the queue into master with commit 7c85ac2 Nov 3, 2025
21 checks passed
@Ericson2314 Ericson2314 deleted the less-c_str branch November 3, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c api Nix as a C library with a stable interface new-cli Relating to the "nix" command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants