google-protobuf 4.27.5-arm64-darwin → 4.28.0-arm64-darwin
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of google-protobuf might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ext/google/protobuf_c/convert.c +37 -13
- data/ext/google/protobuf_c/map.c +72 -20
- data/ext/google/protobuf_c/map.h +6 -2
- data/ext/google/protobuf_c/message.c +74 -35
- data/ext/google/protobuf_c/message.h +1 -1
- data/ext/google/protobuf_c/protobuf.c +11 -9
- data/ext/google/protobuf_c/protobuf.h +3 -7
- data/ext/google/protobuf_c/repeated_field.c +61 -17
- data/ext/google/protobuf_c/repeated_field.h +5 -1
- data/ext/google/protobuf_c/ruby-upb.c +570 -275
- data/ext/google/protobuf_c/ruby-upb.h +1341 -584
- data/lib/google/3.0/protobuf_c.bundle +0 -0
- data/lib/google/3.1/protobuf_c.bundle +0 -0
- data/lib/google/3.2/protobuf_c.bundle +0 -0
- data/lib/google/3.3/protobuf_c.bundle +0 -0
- data/lib/google/protobuf/descriptor_pb.rb +1 -1
- data/lib/google/protobuf/ffi/descriptor.rb +1 -2
- data/lib/google/protobuf/ffi/internal/arena.rb +0 -6
- data/lib/google/protobuf/ffi/internal/convert.rb +13 -6
- data/lib/google/protobuf/ffi/map.rb +45 -21
- data/lib/google/protobuf/ffi/message.rb +182 -60
- data/lib/google/protobuf/ffi/repeated_field.rb +42 -16
- metadata +3 -3
@@ -24,12 +24,14 @@ module Google
|
|
24
24
|
module Protobuf
|
25
25
|
class FFI
|
26
26
|
# Array
|
27
|
-
attach_function :append_array,
|
28
|
-
attach_function :get_msgval_at
|
29
|
-
attach_function :create_array,
|
30
|
-
attach_function :array_resize,
|
31
|
-
attach_function :array_set,
|
32
|
-
attach_function :array_size,
|
27
|
+
attach_function :append_array, :upb_Array_Append, [:Array, MessageValue.by_value, Internal::Arena], :bool
|
28
|
+
attach_function :get_msgval_at, :upb_Array_Get, [:Array, :size_t], MessageValue.by_value
|
29
|
+
attach_function :create_array, :upb_Array_New, [Internal::Arena, CType], :Array
|
30
|
+
attach_function :array_resize, :upb_Array_Resize, [:Array, :size_t, Internal::Arena], :bool
|
31
|
+
attach_function :array_set, :upb_Array_Set, [:Array, :size_t, MessageValue.by_value], :void
|
32
|
+
attach_function :array_size, :upb_Array_Size, [:Array], :size_t
|
33
|
+
attach_function :array_freeze, :upb_Array_Freeze, [:Array, MiniTable.by_ref], :void
|
34
|
+
attach_function :array_frozen?, :upb_Array_IsFrozen, [:Array], :bool
|
33
35
|
end
|
34
36
|
|
35
37
|
class RepeatedField
|
@@ -174,16 +176,36 @@ module Google
|
|
174
176
|
end
|
175
177
|
alias size :length
|
176
178
|
|
179
|
+
##
|
180
|
+
# Is this object frozen?
|
181
|
+
# Returns true if either this Ruby wrapper or the underlying
|
182
|
+
# representation are frozen. Freezes the wrapper if the underlying
|
183
|
+
# representation is already frozen but this wrapper isn't.
|
184
|
+
def frozen?
|
185
|
+
unless Google::Protobuf::FFI.array_frozen? array
|
186
|
+
raise RuntimeError.new "Ruby frozen RepeatedField with mutable representation" if super
|
187
|
+
return false
|
188
|
+
end
|
189
|
+
method(:freeze).super_method.call unless super
|
190
|
+
true
|
191
|
+
end
|
192
|
+
|
193
|
+
##
|
194
|
+
# Freezes the RepeatedField object. We have to intercept this so we can
|
195
|
+
# freeze the underlying representation, not just the Ruby wrapper. Returns
|
196
|
+
# self.
|
177
197
|
def freeze
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
if type == :message
|
182
|
-
each do |element|
|
183
|
-
element.freeze
|
198
|
+
if method(:frozen?).super_method.call
|
199
|
+
unless Google::Protobuf::FFI.array_frozen? array
|
200
|
+
raise RuntimeError.new "Underlying representation of repeated field still mutable despite frozen wrapper"
|
184
201
|
end
|
202
|
+
return self
|
185
203
|
end
|
186
|
-
|
204
|
+
unless Google::Protobuf::FFI.array_frozen? array
|
205
|
+
mini_table = (type == :message) ? Google::Protobuf::FFI.get_mini_table(@descriptor) : nil
|
206
|
+
Google::Protobuf::FFI.array_freeze(array, mini_table)
|
207
|
+
end
|
208
|
+
super
|
187
209
|
end
|
188
210
|
|
189
211
|
def dup
|
@@ -348,10 +370,14 @@ module Google
|
|
348
370
|
OBJECT_CACHE.try_add(@array.address, self)
|
349
371
|
end
|
350
372
|
|
351
|
-
|
352
|
-
#
|
373
|
+
##
|
374
|
+
# Constructor that uses the type information from the given
|
375
|
+
# FieldDescriptor to configure the new RepeatedField instance.
|
376
|
+
# @param field [FieldDescriptor] Type information for the new RepeatedField
|
353
377
|
# @param arena [Arena] Owning message's arena
|
354
|
-
|
378
|
+
# @param values [Enumerable] Initial values
|
379
|
+
# @param array [::FFI::Pointer] Existing upb_Array
|
380
|
+
def self.construct_for_field(field, arena: nil, values: nil, array: nil)
|
355
381
|
instance = allocate
|
356
382
|
options = {initial_values: values, name: field.name, arena: arena, array: array}
|
357
383
|
if [:enum, :message].include? field.type
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-protobuf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.28.0
|
5
5
|
platform: arm64-darwin
|
6
6
|
authors:
|
7
7
|
- Protobuf Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler-dock
|
@@ -190,7 +190,7 @@ homepage: https://developers.google.com/protocol-buffers
|
|
190
190
|
licenses:
|
191
191
|
- BSD-3-Clause
|
192
192
|
metadata:
|
193
|
-
source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v4.
|
193
|
+
source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v4.28.0/ruby
|
194
194
|
post_install_message:
|
195
195
|
rdoc_options: []
|
196
196
|
require_paths:
|