Repository navigation
GH-54687: [GLib] Add missing owner references to GBytes - #54883
Merged
Merged
Conversation
|
|
Member
Author
|
@himotoyoshi Could you try this? |
|
I tried this on macOS (arm64) with Ruby 3.4.1, and it fixes the problem: irb> bytes = Arrow::StringArray.new(["hello world, a long-ish string"]).data_buffer.data Thanks! |
Member
Author
|
Thanks. I'll merge 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.
Rationale for this change
Apache Arrow GLib uses
g_byte_new_static()for zero-copy API. If owner objects are destroyed beforeGBytes,GBytess refer freed data.What changes are included in this PR?
g_byte_new_with_free_func()instead to refer owner objects.GParquetStatisticsrefersGParquetColumnChunkMetadatabecauseGParquetColumnChunkMetadataowns min/max values.gparquet_{,fixed_length_}byte_array_statistics_get_{min,max}(): Use(transfer full)instead of(transfer none)to avoid circular reference. Direct Apache Parquet GLib uses must callg_bytes_unref()manually. This is a backward incompatible change. GObject Introspection users don't care about this. Because GObject Introspection cares about this automatically.Are these changes tested?
Yes.
Are there any user-facing changes?
This PR includes breaking changes to public APIs. The return value of the following functions must be freed by
g_bytes_unref():gparquet_byte_array_statistics_get_min()gparquet_byte_array_statistics_get_max()gparquet_fixed_length_byte_array_statistics_get_min()gparquet_fixed_length_byte_array_statistics_get_max()Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: