pbwire 0.1.11 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2956d0c42aa85e7967b90093883d758085593f49d4c3867a3ff7d1cf43e8ce7a
4
- data.tar.gz: eecebb7fd584098d458d192e8407d648f2386e55eea1e07b8625c667e76d997c
3
+ metadata.gz: cb4f6b7cf39192a4b629a15021602052bfd92a018dada81f4b5a39d698b52d72
4
+ data.tar.gz: 4fb73360db872995f67944c183ca5d1bf471150f02efbdf3bde14ada104f8e16
5
5
  SHA512:
6
- metadata.gz: 69578c6ab2343d42c4c816468e88ca42292c062b9bc5e8c5780446153392702f96588a5d29cad1c7f132f2c25df755ab31dfca9906f82e98ddd8aa93af1432b8
7
- data.tar.gz: f9e02c2cc0321d78cfa58c2baa73897f41ce1141c32708f7940bf31200ccc374cfaf34d1155ebf0b9868cceaef46d5dc5045e7647910c2b72935aefe276c0683
6
+ metadata.gz: 5b9a4e29a0c6e99d8562324fde49a67eaacc250dbe2fdde6050df02958bda1744c44eeaca02c44a5686ba8d002a3c4c7c64f47dd1bc23a542cce79581396fbd6
7
+ data.tar.gz: 39d8591660b5fa4a37ea3c215a3c33ddf698f3c89ee0ad258aa85f6762066779e86d252f7f9cc990f3272fd4262f9009d63675da6044d866fd02b0cd2dce7b94
@@ -13,6 +13,7 @@ skipped a member with an empty or parent path: '../../src/schema.c'
13
13
  skipped a member with an empty or parent path: '../../src/stream.c'
14
14
  skipped a member with an empty or parent path: '../../src/text.c'
15
15
  skipped a member with an empty or parent path: '../../src/wire.c'
16
+ skipped a member with an empty or parent path: '../../src/wkt.c'
16
17
 
17
18
  GNU tar output:
18
19
  tar: Removing leading `../../' from member names
@@ -29,4 +30,5 @@ tar: ../../src/schema.c: Member name contains '..'
29
30
  tar: ../../src/stream.c: Member name contains '..'
30
31
  tar: ../../src/text.c: Member name contains '..'
31
32
  tar: ../../src/wire.c: Member name contains '..'
33
+ tar: ../../src/wkt.c: Member name contains '..'
32
34
  tar: Exiting with failure status due to previous errors
data/README.md CHANGED
@@ -185,14 +185,14 @@ source for all performance numbers; higher is better, MB/s over wire bytes:
185
185
 
186
186
  | payload | op | pbwire-ruby (MB/s, x gem) | gem (MB/s) |
187
187
  |---|---|---|---|
188
- | 136 B | encode | 896.1 (1.29x) | 695.9 |
189
- | 136 B | decode | 392.8 (1.61x) | 243.4 |
190
- | 174 B | encode | 858.1 (1.11x) | 771.0 |
191
- | 174 B | decode | 416.4 (1.68x) | 247.5 |
192
- | 2469 B | encode | 1418.6 (1.16x) | 1222.6 |
193
- | 2469 B | decode | 924.3 (1.88x) | 492.1 |
194
- | 74913 B | encode | 1607.8 (1.22x) | 1312.4 |
195
- | 74913 B | decode | 1122.2 (1.67x) | 673.3 |
188
+ | 136 B | encode | 1015.0 (1.4x) | 741.1 |
189
+ | 136 B | decode | 462.9 (1.8x) | 263.5 |
190
+ | 174 B | encode | 956.9 (1.2x) | 803.2 |
191
+ | 174 B | decode | 514.3 (1.9x) | 267.4 |
192
+ | 2469 B | encode | 1473.1 (1.2x) | 1256.4 |
193
+ | 2469 B | decode | 970.6 (1.8x) | 528.9 |
194
+ | 74913 B | encode | 1582.4 (1.2x) | 1310.6 |
195
+ | 74913 B | decode | 1170.0 (1.7x) | 694.7 |
196
196
 
197
197
  ```shell
198
198
  gem install google-protobuf
@@ -204,7 +204,7 @@ The win is architectural, not a micro-optimization:
204
204
  - **Encoding** writes one pass from the C tree straight into the String that is
205
205
  returned; there is no intermediate buffer and no per-field Ruby call.
206
206
  - **Decoding** is one validating scan that records where each wire field lives;
207
- the gem materializes every field, which is what the 0.44-0.69x numbers mean.
207
+ the gem materializes every field.
208
208
 
209
209
  ## Conformance
210
210
 
@@ -34,6 +34,7 @@
34
34
  #include <pbwire.h>
35
35
 
36
36
  #include <stdint.h>
37
+ #include <stdio.h>
37
38
  #include <stdlib.h>
38
39
  #include <string.h>
39
40
 
@@ -1518,11 +1519,15 @@ schema_s_load(VALUE klass, VALUE bytes)
1518
1519
  status = pbw_descriptor_set_load(RSTRING_PTR(bytes),
1519
1520
  (size_t)RSTRING_LEN(bytes), &schema);
1520
1521
  if (status != PBW_OK) {
1521
- const char *reason = pbw_schema_error(schema);
1522
+ /* the reason lives inside the schema: copy it before freeing */
1523
+ char reason[192];
1524
+ const char *why = pbw_schema_error(schema);
1525
+
1526
+ snprintf(reason, sizeof(reason), "%s",
1527
+ why != NULL ? why : "");
1522
1528
  pbw_schema_free(schema);
1523
1529
  rb_raise(eError, "descriptor set rejected: %s",
1524
- reason != NULL && reason[0] != '\0' ? reason
1525
- : pbw_strerror(status));
1530
+ reason[0] != '\0' ? reason : pbw_strerror(status));
1526
1531
  }
1527
1532
  obj = typed_object_alloc(klass, &schema_data_type, (void **)&self);
1528
1533
  self->holder = holder_new(schema);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pbwire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - jinganix
@@ -29,6 +29,7 @@ files:
29
29
  - "../../src/stream.c"
30
30
  - "../../src/text.c"
31
31
  - "../../src/wire.c"
32
+ - "../../src/wkt.c"
32
33
  - README.md
33
34
  - ext/pbwire_ext/extconf.rb
34
35
  - ext/pbwire_ext/pbwire_ext.c
@@ -51,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
52
  - !ruby/object:Gem::Version
52
53
  version: '0'
53
54
  requirements: []
54
- rubygems_version: 3.6.9
55
+ rubygems_version: 4.0.20
55
56
  specification_version: 4
56
57
  summary: Dynamic protobuf over the pbwire C ABI, schema at runtime
57
58
  test_files: []