google-protobuf 3.24.0 → 3.24.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/google/protobuf_c/protobuf.c +13 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 802cae742cd0aa258920ff9bde883ab655092d76cde65b4b047dd60a5a6ebd24
|
4
|
+
data.tar.gz: 55ca2a83f2a774be049602510b19b1bd53fcc7a5b10988c8a5020cf38aa354c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd69b0c91d8bf5597c5ec98b77b597af7182386d99d78f4a84b4fde0c352a930005ad8bbba83650b5d54069cbb5503be4b302622229edee04d7e2fe8ee790804
|
7
|
+
data.tar.gz: 74c4c1057144c20b2e5efc49f665fd066e7507a32b77222154b3a4bd1dc7c6c1439a12398363a95be45244cc59461b651563c456c1c3916a51ee506de01d447f
|
@@ -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
|
279
|
+
static VALUE ObjectCache_GetKey(const void *key) {
|
280
280
|
VALUE key_val = (VALUE)key;
|
281
281
|
PBRUBY_ASSERT((key_val & 3) == 0);
|
282
|
-
|
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 = (
|
288
|
-
|
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.
|
4
|
+
version: 3.24.3
|
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-
|
11
|
+
date: 2023-09-06 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.
|
111
|
+
source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.24.3/ruby
|
112
112
|
post_install_message:
|
113
113
|
rdoc_options: []
|
114
114
|
require_paths:
|