std: replace mem.Allocator.dupeZ
and mem.orderZ
with *Sentinel
versions
#25290
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similarly to what #25260 did with
fmt.bufPrintZ
, I replacedmem.Allocator.dupeZ
andmem.orderZ
with more genericSentinel
versions, so they can be re-used more.Since most of the
*Z
functions are there to interact with the operating system/c code (ex.posix.mkdirZ
), I didn't change those.One I did consider changing was
mem.joinZ
, though in my opinion it'd be worth completely reworking it (andmem.join
), so it doesn't only work on[]u8
s, but on any slice type.I can do that in this PR too, though some help for naming would be appreciated, cause the
join
functions as they exist currently should be kept and just marked deprecated, but the new, generic functions should also have fitting names.closes #25285
also fixes one of the issues described in #22618