Repository navigation
Expose ArrayRef::inner_mut() and ArrayInner fields as public - #8947
Closed
evanlhatch wants to merge 2 commits into
Closed
evanlhatch wants to merge 2 commits into
evanlhatch wants to merge 2 commits into
Conversation
Signed-off-by: Evan Hatch <44220750+evanlhatch@users.noreply.github.com>
Signed-off-by: Evan Hatch <44220750+evanlhatch@users.noreply.github.com>
Contributor
|
I would really like to be support this functionally without exposing that internal value. What do you want this for exactly. Reusing allocated arrays or do decompress a buffer in-place? |
Contributor
|
Could we move this into an issue first? |
Author
Sure, I made new issue 8696 touching on this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
For use cases that hold a unique
ArrayRef(refcount 1) and want to mutate the underlying buffer in-place, there is currently no public API. The only path istry_into_parts()→try_into_buffer_mut()→ mutate →freeze()→from_buffer_handle()→from_parts_unchecked()— which allocates a newArcand a newArrayInnerevery time, even though the original could be mutated in-place.This is relevant for low-latency applications that mutate columns every tick and hold sole ownership of each
ArrayRef.Changes
ArrayRef::inner_mut():pub(crate)→pubArrayRef::from_inner():pub(crate)→pubArrayRef::dyn_array():pub(crate)→pubArrayInnerstruct + fields:pub(crate)→pubThese are visibility widenings only — no logic changes, no API breaks, no behavioral changes.
Usage