msgpack 1.2.9-x64-mingw32 → 1.2.10-x64-mingw32

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: 61940566ae0a73d0138dec08e810782a1fb720c2f74b0ae98a7be5ebee3d4d21
4
- data.tar.gz: 7a04bfefd4816a07d846b57ee6bd089e69084fcc10eb13a261de39911abb3cff
3
+ metadata.gz: 5107d8022db683529f7f100f64ac9a1c304bceb1dd27a55b50f3be308be414b2
4
+ data.tar.gz: 4b0f7711236e78692e32de145ad97fc27f60e9bdc359e47637245ed89c6a0ab1
5
5
  SHA512:
6
- metadata.gz: 10a9e7420a061e8a6aeefa3860901fc4ad07617482697cc6cd40698873ab6367d630e1515f02370cc4425cfae3507e9a750261853ff194bf84af024ce50c0737
7
- data.tar.gz: e63ef949e0a7f2d1d6ce27475392a2274167db8ef7774abca53108a1df40888b7a54b55225f1b7b13890f4a0af24ea9b07c2591a8271c530814728a2e226eb2a
6
+ metadata.gz: f8c13c8e4be6d454f0c26ff20279e52eff834fd8abc2c1235cf51746bcc383802165889650ef2a19303b3f0e7b9d2952d6ee7367cd6767b2c2057f3cd858d505
7
+ data.tar.gz: e4b77730c1d3eb2bbf6bd64803282cc21c33fe7e0500b359099c2cd07ea964f05d9123b0b8d3e30a9804c63bec4462b958b0525181ff4ad8df23e1a7e9393849
@@ -23,9 +23,9 @@ matrix:
23
23
  os: linux
24
24
  - rvm: 2.5.3
25
25
  os: linux
26
- - rvm: 2.6.0
26
+ - rvm: 2.6.1
27
27
  os: linux
28
- - rvm: 2.6.0
28
+ - rvm: 2.6.1
29
29
  os: osx
30
30
  - rvm: ruby-head
31
31
  os: linux
@@ -36,6 +36,8 @@ matrix:
36
36
  - rvm: jruby-19mode
37
37
  os: linux
38
38
  allow_failures:
39
+ - rvm: 2.6.1
40
+ os: osx
39
41
  - rvm: ruby-head
40
42
  - rvm: jruby-head
41
43
  - rvm: jruby-19mode
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ 2019-04-19 version 1.2.10:
2
+
3
+ * Optimze MessagePack.unpack not to copy source string
4
+
1
5
  2019-03-13 version 1.2.9:
2
6
 
3
7
  * Hotfix release only for JRuby: 1.2.8-java was built incorrectly
@@ -170,7 +170,7 @@ public class Unpacker extends RubyObject {
170
170
  return data == null ? ctx.getRuntime().getFalse() : ctx.getRuntime().getTrue();
171
171
  }
172
172
 
173
- @JRubyMethod(required = 1)
173
+ @JRubyMethod(required = 1, name = "feed", alias = { "feed_reference" })
174
174
  public IRubyObject feed(ThreadContext ctx, IRubyObject data) {
175
175
  ByteList byteList = data.asString().getByteList();
176
176
  if (decoder == null) {
@@ -262,6 +262,20 @@ static inline size_t msgpack_buffer_append_string(msgpack_buffer_t* b, VALUE str
262
262
  return length;
263
263
  }
264
264
 
265
+ static inline size_t msgpack_buffer_append_string_reference(msgpack_buffer_t* b, VALUE string)
266
+ {
267
+ size_t length = RSTRING_LEN(string);
268
+
269
+ if(length > MSGPACK_BUFFER_STRING_WRITE_REFERENCE_MINIMUM) {
270
+ _msgpack_buffer_append_long_string(b, string);
271
+
272
+ } else {
273
+ msgpack_buffer_append(b, RSTRING_PTR(string), length);
274
+ }
275
+
276
+ return length;
277
+ }
278
+
265
279
 
266
280
  /*
267
281
  * IO functions
@@ -256,6 +256,17 @@ static VALUE Unpacker_feed(VALUE self, VALUE data)
256
256
  return self;
257
257
  }
258
258
 
259
+ static VALUE Unpacker_feed_reference(VALUE self, VALUE data)
260
+ {
261
+ UNPACKER(self, uk);
262
+
263
+ StringValue(data);
264
+
265
+ msgpack_buffer_append_string_reference(UNPACKER_BUFFER_(uk), data);
266
+
267
+ return self;
268
+ }
269
+
259
270
  static VALUE Unpacker_each_impl(VALUE self)
260
271
  {
261
272
  UNPACKER(self, uk);
@@ -312,8 +323,7 @@ static VALUE Unpacker_feed_each(VALUE self, VALUE data)
312
323
  }
313
324
  #endif
314
325
 
315
- // TODO optimize
316
- Unpacker_feed(self, data);
326
+ Unpacker_feed_reference(self, data);
317
327
  return Unpacker_each(self);
318
328
  }
319
329
 
@@ -386,9 +396,6 @@ static VALUE Unpacker_full_unpack(VALUE self)
386
396
  {
387
397
  UNPACKER(self, uk);
388
398
 
389
- /* prefer reference than copying; see MessagePack_Unpacker_module_init */
390
- msgpack_buffer_set_write_reference_threshold(UNPACKER_BUFFER_(uk), 0);
391
-
392
399
  int r = msgpack_unpacker_read(uk, 0);
393
400
  if(r < 0) {
394
401
  raise_unpacker_error(r);
@@ -444,6 +451,7 @@ void MessagePack_Unpacker_module_init(VALUE mMessagePack)
444
451
  rb_define_method(cMessagePack_Unpacker, "read_map_header", Unpacker_read_map_header, 0);
445
452
  //rb_define_method(cMessagePack_Unpacker, "peek_next_type", Unpacker_peek_next_type, 0); // TODO
446
453
  rb_define_method(cMessagePack_Unpacker, "feed", Unpacker_feed, 1);
454
+ rb_define_method(cMessagePack_Unpacker, "feed_reference", Unpacker_feed_reference, 1);
447
455
  rb_define_method(cMessagePack_Unpacker, "each", Unpacker_each, 0);
448
456
  rb_define_method(cMessagePack_Unpacker, "feed_each", Unpacker_feed_each, 1);
449
457
  rb_define_method(cMessagePack_Unpacker, "reset", Unpacker_reset, 0);
@@ -27,7 +27,7 @@ module MessagePack
27
27
 
28
28
  if src.is_a? String
29
29
  unpacker = DefaultFactory.unpacker param || DEFAULT_EMPTY_PARAMS
30
- unpacker.feed src
30
+ unpacker.feed_reference src
31
31
  else
32
32
  unpacker = DefaultFactory.unpacker src, param || DEFAULT_EMPTY_PARAMS
33
33
  end
@@ -1,5 +1,5 @@
1
1
  module MessagePack
2
- VERSION = "1.2.9"
2
+ VERSION = "1.2.10"
3
3
 
4
4
  # NOTE for msgpack-ruby maintainer:
5
5
  # Check these things to release new binaryes for new Ruby versions (especially for Windows):
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.9
4
+ version: 1.2.10
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Sadayuki Furuhashi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-03-13 00:00:00.000000000 Z
13
+ date: 2019-04-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  version: '0'
247
247
  requirements: []
248
248
  rubyforge_project: msgpack
249
- rubygems_version: 2.7.8
249
+ rubygems_version: 2.7.9
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: MessagePack, a binary-based efficient data interchange format.