google-protobuf 3.24.0.rc.3 → 3.24.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5705fa961755a96ef967a876e7d7e62361483ff97f66b45ac47711150d090c6
4
- data.tar.gz: aa6591f5a65c8f9d4aa5d34bb9183bd515e4dd08a62c062aab6c2b6ced3740d3
3
+ metadata.gz: ab19f3d9a087b8f4b288ba5a610f1d85d5fc71f1939b34891bea8e8be9736069
4
+ data.tar.gz: 26e9e6b1108d10b1a1098af1820bfd6b4e7a6c892ae9bb946897d78ca765f624
5
5
  SHA512:
6
- metadata.gz: 1fcca4454adbae86d53166b0164ba9a9e74bb9d744b2acadf98d4981d95b2b338a808325abead4918aa8d5191c25e9787106ef4aad7287229569f800e9a3cb7a
7
- data.tar.gz: f92a80adaf1e1c9e6cab80aa0cfc721ebb43dad956329079d0fe88901fe4da10aa0c36698e682a3080e33eb9b422e865bf5548b5f866c492634e48f4832ff54a
6
+ metadata.gz: ff7e8795da8bc005ccf210891a7ef2e325a5e372ca1e6f66c00611ae2743680c7f276e2352502bdf20c23a74a0e8f6910f35b03165baf43860da797044594826
7
+ data.tar.gz: 8c0d6011a2b6f407e06fec6779f0dbdc5f6400a4afa04edc9cc63023785ab51eac053159c7c5c0297726e6ff83a1a71c0fdf17c3b2b7ef644c5623f72f560778
@@ -276,17 +276,25 @@ static void ObjectCache_Init(VALUE protobuf) {
276
276
  rb_const_set(protobuf, rb_intern("SIZEOF_VALUE"), INT2NUM(SIZEOF_VALUE));
277
277
  }
278
278
 
279
- VALUE ObjectCache_TryAdd(const void *key, VALUE val) {
279
+ static VALUE ObjectCache_GetKey(const void *key) {
280
280
  VALUE key_val = (VALUE)key;
281
281
  PBRUBY_ASSERT((key_val & 3) == 0);
282
- return rb_funcall(weak_obj_cache, item_try_add, 2, LL2NUM(key_val), val);
282
+ // Ensure the key can be stored as a Fixnum since 1 bit is needed for
283
+ // FIXNUM_FLAG and 1 bit is needed for the sign bit.
284
+ VALUE new_key = LL2NUM(key_val >> 2);
285
+ PBRUBY_ASSERT(FIXNUM_P(new_key));
286
+ return new_key;
287
+ }
288
+
289
+ VALUE ObjectCache_TryAdd(const void *key, VALUE val) {
290
+ VALUE key_val = ObjectCache_GetKey(key);
291
+ return rb_funcall(weak_obj_cache, item_try_add, 2, key_val, val);
283
292
  }
284
293
 
285
294
  // Returns the cached object for this key, if any. Otherwise returns Qnil.
286
295
  VALUE ObjectCache_Get(const void *key) {
287
- VALUE key_val = (VALUE)key;
288
- PBRUBY_ASSERT((key_val & 3) == 0);
289
- return rb_funcall(weak_obj_cache, item_get, 1, LL2NUM(key_val));
296
+ VALUE key_val = ObjectCache_GetKey(key);
297
+ return rb_funcall(weak_obj_cache, item_get, 1, key_val);
290
298
  }
291
299
 
292
300
  /*
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: 3.24.0.rc.3
4
+ version: 3.24.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Protobuf Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-01 00:00:00.000000000 Z
11
+ date: 2023-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler-dock
@@ -108,7 +108,7 @@ homepage: https://developers.google.com/protocol-buffers
108
108
  licenses:
109
109
  - BSD-3-Clause
110
110
  metadata:
111
- source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.24.0-rc3/ruby
111
+ source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.24.1/ruby
112
112
  post_install_message:
113
113
  rdoc_options: []
114
114
  require_paths:
@@ -120,9 +120,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
120
  version: '2.7'
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ">"
123
+ - - ">="
124
124
  - !ruby/object:Gem::Version
125
- version: 1.3.1
125
+ version: '0'
126
126
  requirements: []
127
127
  rubygems_version: 3.0.8
128
128
  signing_key: