Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-msgpack for openSUSE:Factory
checked in at 2022-08-09 15:26:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-msgpack (Old)
and /work/SRC/openSUSE:Factory/.rubygem-msgpack.new.1521 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-msgpack"
Tue Aug 9 15:26:42 2022 rev:19 rq:993498 version:1.5.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-msgpack/rubygem-msgpack.changes
2022-07-08 14:03:27.866555381 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-msgpack.new.1521/rubygem-msgpack.changes
2022-08-09 15:26:57.101385059 +0200
@@ -1,0 +2,12 @@
+Thu Aug 4 13:19:05 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 1.5.4
+ see installed ChangeLog
+
+ 2022-07-25
+
+ * Fix a segfault when deserializing empty symbol (`:""`).
+ * Improve compilation flags to not strip debug symbols.
+
+
+-------------------------------------------------------------------
Old:
----
msgpack-1.5.3.gem
New:
----
msgpack-1.5.4.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-msgpack.spec ++++++
--- /var/tmp/diff_new_pack.1hdyzI/_old 2022-08-09 15:26:57.665386670 +0200
+++ /var/tmp/diff_new_pack.1hdyzI/_new 2022-08-09 15:26:57.669386681 +0200
@@ -24,7 +24,7 @@
#
Name: rubygem-msgpack
-Version: 1.5.3
+Version: 1.5.4
Release: 0
%define mod_name msgpack
%define mod_full_name %{mod_name}-%{version}
++++++ msgpack-1.5.3.gem -> msgpack-1.5.4.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ChangeLog new/ChangeLog
--- old/ChangeLog 2022-07-01 11:53:25.000000000 +0200
+++ new/ChangeLog 2022-07-25 09:34:23.000000000 +0200
@@ -1,3 +1,8 @@
+2022-07-25
+
+* Fix a segfault when deserializing empty symbol (`:""`).
+* Improve compilation flags to not strip debug symbols.
+
2022-05-30 version 1.5.3:
* Fix deduplication of empty strings when using the `freeze: true` option.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2022-07-01 11:53:25.000000000 +0200
+++ new/README.md 2022-07-25 09:34:23.000000000 +0200
@@ -40,7 +40,7 @@
MessagePack for Ruby should run on x86, ARM, PowerPC, SPARC and other CPU
architectures.
And it works with MRI (CRuby) and Rubinius.
-Patches to improve portability is highly welcomed.
+Patches to improve portability are highly welcomed.
## Serializing objects
@@ -51,6 +51,7 @@
require 'msgpack'
msg = MessagePack.pack(obj) # or
msg = obj.to_msgpack
+File.binwrite('mydata.msgpack', msg)
```
### Streaming serialization
@@ -71,6 +72,7 @@
```ruby
require 'msgpack'
+msg = File.binread('mydata.msgpack')
obj = MessagePack.unpack(msg)
```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/bench.rb new/bench/bench.rb
--- old/bench/bench.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/bench/bench.rb 2022-07-25 09:34:23.000000000 +0200
@@ -0,0 +1,78 @@
+# % bundle install
+# % bundle exec ruby bench/bench.rb
+
+require 'msgpack'
+
+require 'benchmark/ips'
+
+object_plain = {
+ 'message' => '127.0.0.1 - - [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif
HTTP/1.0" 200 2326 "http://www.example.com/start.html" "Mozilla/4.08 [en]
(Win98; I ;Nav)"'
+}
+
+data_plain = MessagePack.pack(object_plain)
+
+object_structured = {
+ 'remote_host' => '127.0.0.1',
+ 'remote_user' => '-',
+ 'date' => '10/Oct/2000:13:55:36 -0700',
+ 'request' => 'GET /apache_pb.gif HTTP/1.0',
+ 'method' => 'GET',
+ 'path' => '/apache_pb.gif',
+ 'protocol' => 'HTTP/1.0',
+ 'status' => 200,
+ 'bytes' => 2326,
+ 'referer' => 'http://www.example.com/start.html',
+ 'agent' => 'Mozilla/4.08 [en] (Win98; I ;Nav)',
+}
+
+data_structured = MessagePack.pack(object_structured)
+
+class Extended
+ def to_msgpack_ext
+ MessagePack.pack({})
+ end
+
+ def self.from_msgpack_ext(data)
+ MessagePack.unpack(data)
+ Extended.new
+ end
+end
+
+object_extended = {
+ 'extended' => Extended.new
+}
+
+extended_packer = MessagePack::Packer.new
+extended_packer.register_type(0x00, Extended, :to_msgpack_ext)
+data_extended = extended_packer.pack(object_extended).to_s
+
+Benchmark.ips do |x|
+ x.report('pack-plain') do
+ MessagePack.pack(object_plain)
+ end
+
+ x.report('pack-structured') do
+ MessagePack.pack(object_structured)
+ end
+
+ x.report('pack-extended') do
+ packer = MessagePack::Packer.new
+ packer.register_type(0x00, Extended, :to_msgpack_ext)
+ packer.pack(object_extended).to_s
+ end
+
+ x.report('unpack-plain') do
+ MessagePack.unpack(data_plain)
+ end
+
+ x.report('unpack-structured') do
+ MessagePack.unpack(data_structured)
+ end
+
+ x.report('unpack-extended') do
+ unpacker = MessagePack::Unpacker.new
+ unpacker.register_type(0x00, Extended, :from_msgpack_ext)
+ unpacker.feed data_extended
+ unpacker.read
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/pack.rb new/bench/pack.rb
--- old/bench/pack.rb 2022-07-01 11:53:25.000000000 +0200
+++ new/bench/pack.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-require 'viiite'
-require 'msgpack'
-
-data = { 'hello' => 'world', 'nested' => ['structure', {value: 42}] }
-data_sym = { hello: 'world', nested: ['structure', {value: 42}] }
-
-data = MessagePack.pack(:hello => 'world', :nested => ['structure', {:value =>
42}])
-
-Viiite.bench do |b|
- b.range_over([10_000, 100_000, 1000_000], :runs) do |runs|
- b.report(:strings) do
- runs.times do
- MessagePack.pack(data)
- end
- end
-
- b.report(:symbols) do
- runs.times do
- MessagePack.pack(data_sym)
- end
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/pack_log.rb new/bench/pack_log.rb
--- old/bench/pack_log.rb 2022-07-01 11:53:25.000000000 +0200
+++ new/bench/pack_log.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,33 +0,0 @@
-require 'viiite'
-require 'msgpack'
-
-data_plain = { 'message' => '127.0.0.1 - - [10/Oct/2000:13:55:36 -0700] "GET
/apache_pb.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html"
"Mozilla/4.08 [en] (Win98; I ;Nav)"' }
-data_structure = {
- 'remote_host' => '127.0.0.1',
- 'remote_user' => '-',
- 'date' => '10/Oct/2000:13:55:36 -0700',
- 'request' => 'GET /apache_pb.gif HTTP/1.0',
- 'method' => 'GET',
- 'path' => '/apache_pb.gif',
- 'protocol' => 'HTTP/1.0',
- 'status' => 200,
- 'bytes' => 2326,
- 'referer' => 'http://www.example.com/start.html',
- 'agent' => 'Mozilla/4.08 [en] (Win98; I ;Nav)',
-}
-
-Viiite.bench do |b|
- b.range_over([10_000, 100_000, 1000_000], :runs) do |runs|
- b.report(:plain) do
- runs.times do
- MessagePack.pack(data_plain)
- end
- end
-
- b.report(:structure) do
- runs.times do
- MessagePack.pack(data_structure)
- end
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/pack_log_long.rb new/bench/pack_log_long.rb
--- old/bench/pack_log_long.rb 2022-07-01 11:53:25.000000000 +0200
+++ new/bench/pack_log_long.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,65 +0,0 @@
-# viiite report --regroup bench,threads bench/pack_log_long.rb
-
-require 'viiite'
-require 'msgpack'
-
-data_plain = { 'message' => '127.0.0.1 - - [10/Oct/2000:13:55:36 -0700] "GET
/apache_pb.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html"
"Mozilla/4.08 [en] (Win98; I ;Nav)"' }
-data_structure = {
- 'remote_host' => '127.0.0.1',
- 'remote_user' => '-',
- 'date' => '10/Oct/2000:13:55:36 -0700',
- 'request' => 'GET /apache_pb.gif HTTP/1.0',
- 'method' => 'GET',
- 'path' => '/apache_pb.gif',
- 'protocol' => 'HTTP/1.0',
- 'status' => 200,
- 'bytes' => 2326,
- 'referer' => 'http://www.example.com/start.html',
- 'agent' => 'Mozilla/4.08 [en] (Win98; I ;Nav)',
-}
-
-seconds = 3600 # 1 hour
-
-Viiite.bench do |b|
- b.range_over([1, 2, 4, 8, 16], :threads) do |threads|
- b.report(:plain) do
- ths = []
- end_at = Time.now + seconds
- threads.times do
- t = Thread.new do
- packs = 0
- while Time.now < end_at
- 10000.times do
- MessagePack.pack(data_plain)
- end
- packs += 10000
- end
- packs
- end
- ths.push t
- end
- sum = ths.reduce(0){|r,t| r + t.value }
- puts "MessagePack.pack, plain, #{threads} threads: #{sum} times, #{sum /
seconds} times/second."
- end
-
- b.report(:structure) do
- ths = []
- end_at = Time.now + seconds
- threads.times do
- t = Thread.new do
- packs = 0
- while Time.now < end_at
- 10000.times do
- MessagePack.pack(data_structure)
- end
- packs += 10000
- end
- packs
- end
- ths.push t
- end
- sum = ths.reduce(0){|r,t| r + t.value }
- puts "MessagePack.pack, structured, #{threads} threads: #{sum} times,
#{sum / seconds} times/second."
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/pack_symbols.rb new/bench/pack_symbols.rb
--- old/bench/pack_symbols.rb 2022-07-01 11:53:25.000000000 +0200
+++ new/bench/pack_symbols.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,28 +0,0 @@
-require 'viiite'
-require 'msgpack'
-
-data = :symbol
-
-Viiite.bench do |b|
- b.variation_point :branch, `git rev-parse --abbrev-ref HEAD`
-
- b.range_over([:symbol, :none], :reg_type) do |reg_type|
- packer = MessagePack::Packer.new
- packer.register_type(0x00, Symbol, :to_msgpack_ext) if reg_type == :symbol
-
- b.range_over([100_000, 1_000_000, 10_000_000], :count) do |count|
- packer.clear
- b.report(:multi_run) do
- count.times do
- packer.pack(data)
- end
- end
-
- packer.clear
- items_data = [].fill(data, 0, count)
- b.report(:large_run) do
- packer.pack(items_data)
- end
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/run.sh new/bench/run.sh
--- old/bench/run.sh 2022-07-01 11:53:25.000000000 +0200
+++ new/bench/run.sh 1970-01-01 01:00:00.000000000 +0100
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-# prerequisites
-# $ rbenv shell 2.2.1 (or jruby-x.x.x or ...)
-# $ rake install
-
-echo "pack"
-viiite report --regroup bench,runs bench/pack.rb
-echo "unpack"
-viiite report --regroup bench,runs bench/unpack.rb
-echo "pack log"
-viiite report --regroup bench,runs bench/pack_log.rb
-echo "unpack log"
-viiite report --regroup bench,runs bench/unpack_log.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/run_long.sh new/bench/run_long.sh
--- old/bench/run_long.sh 2022-07-01 11:53:25.000000000 +0200
+++ new/bench/run_long.sh 1970-01-01 01:00:00.000000000 +0100
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-# prerequisites
-# $ sudo apt-get install sysstat
-# $ rbenv shell 2.2.1 (or jruby-x.x.x or ...)
-# $ rake install
-
-# 60 * 600 : 60*60 * 5[threads] * 2[bench]
-
-ruby -v
-
-echo "pack log long"
-viiite report --regroup bench,threads bench/pack_log_long.rb &
-sar -o pack_log_long.sar -r 60 600 > /dev/null 2>&1 &
-
-declare -i i=0
-while [ $i -lt 600 ]; do
- ps auxww | grep ruby | grep -v grep | awk '{print $5,$6;}' >>
pack_log_long.mem.txt
- i=i+1
- sleep 60
-done
-
-sleep 120 # cool down
-
-echo "unpack log long"
-viiite report --regroup bench,threads bench/unpack_log_long.rb &
-sar -o unpack_log_long.sar -r 60 600 > /dev/null 2>&1 &
-
-i=0
-while [ $i -lt 600 ]; do
- ps auxww | grep ruby | grep -v grep | awk '{print $5,$6;}' >>
pack_log_long.mem.txt
- i=i+1
- sleep 60
-done
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/run_symbols.sh new/bench/run_symbols.sh
--- old/bench/run_symbols.sh 2022-07-01 11:53:25.000000000 +0200
+++ new/bench/run_symbols.sh 1970-01-01 01:00:00.000000000 +0100
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-# so master and this branch have the benchmark file in any case
-cp bench/pack_symbols.rb bench/pack_symbols_tmp.rb
-
-benchmark=""
-current_branch=`git rev-parse --abbrev-ref HEAD`
-
-for branch in master $current_branch; do
- echo "Testing branch $branch"
- git checkout $branch
-
- echo "Installing gem..."
- rake install
-
- echo "Running benchmark..."
- if [ "$benchmark" ]; then
- benchmark+=$'\n'
- fi
- benchmark+=$(viiite run bench/pack_symbols_tmp.rb)
- echo
-done
-
-rm bench/pack_symbols_tmp.rb
-
-echo "$benchmark" | viiite report --regroup bench,reg_type,count,branch
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/unpack.rb new/bench/unpack.rb
--- old/bench/unpack.rb 2022-07-01 11:53:25.000000000 +0200
+++ new/bench/unpack.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,21 +0,0 @@
-require 'viiite'
-require 'msgpack'
-
-data = MessagePack.pack(:hello => 'world', :nested => ['structure', {:value =>
42}])
-
-Viiite.bench do |b|
- b.range_over([10_000, 100_000, 1000_000], :runs) do |runs|
- b.report(:strings) do
- runs.times do
- MessagePack.unpack(data)
- end
- end
-
- b.report(:symbols) do
- options = {:symbolize_keys => true}
- runs.times do
- MessagePack.unpack(data, options)
- end
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/unpack_log.rb new/bench/unpack_log.rb
--- old/bench/unpack_log.rb 2022-07-01 11:53:25.000000000 +0200
+++ new/bench/unpack_log.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,34 +0,0 @@
-require 'viiite'
-require 'msgpack'
-
-data_plain = MessagePack.pack({ 'message' => '127.0.0.1 - -
[10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
"http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)"' })
-
-data_structure = MessagePack.pack({
- 'remote_host' => '127.0.0.1',
- 'remote_user' => '-',
- 'date' => '10/Oct/2000:13:55:36 -0700',
- 'request' => 'GET /apache_pb.gif HTTP/1.0',
- 'method' => 'GET',
- 'path' => '/apache_pb.gif',
- 'protocol' => 'HTTP/1.0',
- 'status' => 200,
- 'bytes' => 2326,
- 'referer' => 'http://www.example.com/start.html',
- 'agent' => 'Mozilla/4.08 [en] (Win98; I ;Nav)',
-})
-
-Viiite.bench do |b|
- b.range_over([10_000, 100_000, 1000_000], :runs) do |runs|
- b.report(:plain) do
- runs.times do
- MessagePack.unpack(data_plain)
- end
- end
-
- b.report(:structure) do
- runs.times do
- MessagePack.unpack(data_structure)
- end
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/bench/unpack_log_long.rb new/bench/unpack_log_long.rb
--- old/bench/unpack_log_long.rb 2022-07-01 11:53:25.000000000 +0200
+++ new/bench/unpack_log_long.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,67 +0,0 @@
-# viiite report --regroup bench,threads bench/pack_log_long.rb
-
-require 'viiite'
-require 'msgpack'
-
-data_plain = MessagePack.pack({
- 'message' => '127.0.0.1 - - [10/Oct/2000:13:55:36 -0700] "GET
/apache_pb.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html"
"Mozilla/4.08 [en] (Win98; I ;Nav)"'
-})
-data_structure = MessagePack.pack({
- 'remote_host' => '127.0.0.1',
- 'remote_user' => '-',
- 'date' => '10/Oct/2000:13:55:36 -0700',
- 'request' => 'GET /apache_pb.gif HTTP/1.0',
- 'method' => 'GET',
- 'path' => '/apache_pb.gif',
- 'protocol' => 'HTTP/1.0',
- 'status' => 200,
- 'bytes' => 2326,
- 'referer' => 'http://www.example.com/start.html',
- 'agent' => 'Mozilla/4.08 [en] (Win98; I ;Nav)',
-})
-
-seconds = 3600 # 1 hour
-
-Viiite.bench do |b|
- b.range_over([1, 2, 4, 8, 16], :threads) do |threads|
- b.report(:plain) do
- ths = []
- end_at = Time.now + seconds
- threads.times do
- t = Thread.new do
- packs = 0
- while Time.now < end_at
- 10000.times do
- MessagePack.unpack(data_plain)
- end
- packs += 10000
- end
- packs
- end
- ths.push t
- end
- sum = ths.reduce(0){|r,t| r + t.value }
- puts "MessagePack.unpack, plain, #{threads} threads: #{sum} times, #{sum
/ seconds} times/second."
- end
-
- b.report(:structure) do
- ths = []
- end_at = Time.now + seconds
- threads.times do
- t = Thread.new do
- packs = 0
- while Time.now < end_at
- 10000.times do
- MessagePack.unpack(data_structure)
- end
- packs += 10000
- end
- packs
- end
- ths.push t
- end
- sum = ths.reduce(0){|r,t| r + t.value }
- puts "MessagePack.unpack, structured, #{threads} threads: #{sum} times,
#{sum / seconds} times/second."
- end
- end
-end
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/msgpack/buffer.c new/ext/msgpack/buffer.c
--- old/ext/msgpack/buffer.c 2022-07-01 11:53:25.000000000 +0200
+++ new/ext/msgpack/buffer.c 2022-07-25 09:34:23.000000000 +0200
@@ -588,13 +588,13 @@
size_t _msgpack_buffer_feed_from_io(msgpack_buffer_t* b)
{
if(b->io_buffer == Qnil) {
- b->io_buffer = rb_funcall(b->io, b->io_partial_read_method, 1,
LONG2NUM(b->io_buffer_size));
+ b->io_buffer = rb_funcall(b->io, b->io_partial_read_method, 1,
SIZET2NUM(b->io_buffer_size));
if(b->io_buffer == Qnil) {
rb_raise(rb_eEOFError, "IO reached end of file");
}
StringValue(b->io_buffer);
} else {
- VALUE ret = rb_funcall(b->io, b->io_partial_read_method, 2,
LONG2NUM(b->io_buffer_size), b->io_buffer);
+ VALUE ret = rb_funcall(b->io, b->io_partial_read_method, 2,
SIZET2NUM(b->io_buffer_size), b->io_buffer);
if(ret == Qnil) {
rb_raise(rb_eEOFError, "IO reached end of file");
}
@@ -615,7 +615,7 @@
{
if(RSTRING_LEN(string) == 0) {
/* direct read */
- VALUE ret = rb_funcall(b->io, b->io_partial_read_method, 2,
LONG2NUM(length), string);
+ VALUE ret = rb_funcall(b->io, b->io_partial_read_method, 2,
SIZET2NUM(length), string);
if(ret == Qnil) {
return 0;
}
@@ -627,7 +627,7 @@
b->io_buffer = rb_str_buf_new(0);
}
- VALUE ret = rb_funcall(b->io, b->io_partial_read_method, 2,
LONG2NUM(length), b->io_buffer);
+ VALUE ret = rb_funcall(b->io, b->io_partial_read_method, 2,
SIZET2NUM(length), b->io_buffer);
if(ret == Qnil) {
return 0;
}
@@ -643,7 +643,7 @@
b->io_buffer = rb_str_buf_new(0);
}
- VALUE ret = rb_funcall(b->io, b->io_partial_read_method, 2,
LONG2NUM(length), b->io_buffer);
+ VALUE ret = rb_funcall(b->io, b->io_partial_read_method, 2,
SIZET2NUM(length), b->io_buffer);
if(ret == Qnil) {
return 0;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/msgpack/buffer_class.c
new/ext/msgpack/buffer_class.c
--- old/ext/msgpack/buffer_class.c 2022-07-01 11:53:25.000000000 +0200
+++ new/ext/msgpack/buffer_class.c 2022-07-25 09:34:23.000000000 +0200
@@ -96,17 +96,17 @@
v = rb_hash_aref(options, sym_read_reference_threshold);
if(v != Qnil) {
- msgpack_buffer_set_read_reference_threshold(b, NUM2ULONG(v));
+ msgpack_buffer_set_read_reference_threshold(b, NUM2SIZET(v));
}
v = rb_hash_aref(options, sym_write_reference_threshold);
if(v != Qnil) {
- msgpack_buffer_set_write_reference_threshold(b, NUM2ULONG(v));
+ msgpack_buffer_set_write_reference_threshold(b, NUM2SIZET(v));
}
v = rb_hash_aref(options, sym_io_buffer_size);
if(v != Qnil) {
- msgpack_buffer_set_io_buffer_size(b, NUM2ULONG(v));
+ msgpack_buffer_set_io_buffer_size(b, NUM2SIZET(v));
}
}
}
@@ -301,11 +301,11 @@
/* do nothing */
if(n == 0) {
- return ULONG2NUM(0);
+ return INT2NUM(0);
}
size_t sz = read_until_eof(b, Qnil, n);
- return ULONG2NUM(sz);
+ return SIZET2NUM(sz);
}
static VALUE Buffer_skip_all(VALUE self, VALUE sn)
@@ -473,7 +473,7 @@
{
BUFFER(self, b);
size_t sz = msgpack_buffer_flush_to_io(b, io, s_write, true);
- return ULONG2NUM(sz);
+ return SIZET2NUM(sz);
}
void MessagePack_Buffer_module_init(VALUE mMessagePack)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/msgpack/extconf.rb new/ext/msgpack/extconf.rb
--- old/ext/msgpack/extconf.rb 2022-07-01 11:53:25.000000000 +0200
+++ new/ext/msgpack/extconf.rb 2022-07-25 09:34:23.000000000 +0200
@@ -6,7 +6,7 @@
have_func("rb_hash_new_capa", "ruby.h") # Ruby 3.2+
unless RUBY_PLATFORM.include? 'mswin'
- $CFLAGS << %[ -I.. -Wall -O3 -g -std=gnu99]
+ $CFLAGS << %[ -I.. -Wall -O3 #{RbConfig::CONFIG["debugflags"]} -std=gnu99]
end
#$CFLAGS << %[ -DDISABLE_RMEM]
#$CFLAGS << %[ -DDISABLE_RMEM_REUSE_INTERNAL_FRAGMENT]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/msgpack/packer_class.c
new/ext/msgpack/packer_class.c
--- old/ext/msgpack/packer_class.c 2022-07-01 11:53:25.000000000 +0200
+++ new/ext/msgpack/packer_class.c 2022-07-25 09:34:23.000000000 +0200
@@ -322,7 +322,7 @@
{
PACKER(self, pk);
size_t sz = msgpack_buffer_flush_to_io(PACKER_BUFFER_(pk), io, s_write,
true);
- return ULONG2NUM(sz);
+ return SIZET2NUM(sz);
}
//static VALUE Packer_append(VALUE self, VALUE string_or_buffer)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/msgpack/unpacker.c new/ext/msgpack/unpacker.c
--- old/ext/msgpack/unpacker.c 2022-07-01 11:53:25.000000000 +0200
+++ new/ext/msgpack/unpacker.c 2022-07-25 09:34:23.000000000 +0200
@@ -177,6 +177,9 @@
static inline int object_complete_ext(msgpack_unpacker_t* uk, int ext_type,
VALUE str)
{
if (uk->optimized_symbol_ext_type && ext_type == uk->symbol_ext_type) {
+ if (RB_UNLIKELY(NIL_P(str))) { // empty extension is returned as Qnil
+ return object_complete_symbol(uk, ID2SYM(rb_intern3("", 0,
rb_utf8_encoding())));
+ }
return object_complete_symbol(uk, rb_str_intern(str));
}
@@ -477,7 +480,7 @@
{
READ_CAST_BLOCK_OR_RETURN_EOF(cb, uk, 4);
uint32_t u32 = _msgpack_be32(cb->u32);
- return object_complete(uk, ULONG2NUM((unsigned long)u32));
+ return object_complete(uk, ULONG2NUM(u32)); // long at least
32 bits
}
case 0xcf: // unsigned int 64
@@ -505,7 +508,7 @@
{
READ_CAST_BLOCK_OR_RETURN_EOF(cb, uk, 4);
int32_t i32 = _msgpack_be32(cb->i32);
- return object_complete(uk, LONG2NUM((long)i32));
+ return object_complete(uk, LONG2NUM(i32)); // long at least 32
bits
}
case 0xd3: // signed int 64
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/msgpack/unpacker_class.c
new/ext/msgpack/unpacker_class.c
--- old/ext/msgpack/unpacker_class.c 2022-07-01 11:53:25.000000000 +0200
+++ new/ext/msgpack/unpacker_class.c 2022-07-25 09:34:23.000000000 +0200
@@ -209,7 +209,7 @@
raise_unpacker_error(r);
}
- return ULONG2NUM(size);
+ return ULONG2NUM(size); // long at least 32 bits
}
static VALUE Unpacker_read_map_header(VALUE self)
@@ -222,7 +222,7 @@
raise_unpacker_error((int)r);
}
- return ULONG2NUM(size);
+ return ULONG2NUM(size); // long at least 32 bits
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/msgpack/version.rb new/lib/msgpack/version.rb
--- old/lib/msgpack/version.rb 2022-07-01 11:53:25.000000000 +0200
+++ new/lib/msgpack/version.rb 2022-07-25 09:34:23.000000000 +0200
@@ -1,5 +1,5 @@
module MessagePack
- VERSION = "1.5.3"
+ VERSION = "1.5.4"
# Note for maintainers:
# Don't miss building/releasing the JRuby version (rake buld:java)
# See "How to build -java rubygems" in README for more details.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2022-07-01 11:53:25.000000000 +0200
+++ new/metadata 2022-07-25 09:34:23.000000000 +0200
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: msgpack
version: !ruby/object:Gem::Version
- version: 1.5.3
+ version: 1.5.4
platform: ruby
authors:
- Sadayuki Furuhashi
@@ -10,7 +10,7 @@
autorequire:
bindir: bin
cert_chain: []
-date: 2022-07-01 00:00:00.000000000 Z
+date: 2022-07-25 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: bundler
@@ -96,6 +96,20 @@
- - ">="
- !ruby/object:Gem::Version
version: '0'
+- !ruby/object:Gem::Dependency
+ name: benchmark-ips
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - "~>"
+ - !ruby/object:Gem::Version
+ version: 2.10.0
+ type: :development
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - "~>"
+ - !ruby/object:Gem::Version
+ version: 2.10.0
description: MessagePack is a binary-based efficient object serialization
library.
It enables to exchange structured objects between many languages like JSON.
But
unlike JSON, it is very fast and small.
@@ -117,16 +131,7 @@
- README.md
- Rakefile
- appveyor.yml
-- bench/pack.rb
-- bench/pack_log.rb
-- bench/pack_log_long.rb
-- bench/pack_symbols.rb
-- bench/run.sh
-- bench/run_long.sh
-- bench/run_symbols.sh
-- bench/unpack.rb
-- bench/unpack_log.rb
-- bench/unpack_log_long.rb
+- bench/bench.rb
- doclib/msgpack.rb
- doclib/msgpack/buffer.rb
- doclib/msgpack/core_ext.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/msgpack.gemspec new/msgpack.gemspec
--- old/msgpack.gemspec 2022-07-01 11:53:25.000000000 +0200
+++ new/msgpack.gemspec 2022-07-25 09:34:23.000000000 +0200
@@ -27,4 +27,5 @@
s.add_development_dependency 'rspec', ['~> 3.3']
s.add_development_dependency 'yard'
s.add_development_dependency 'json'
+ s.add_development_dependency 'benchmark-ips', ['~> 2.10.0']
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/factory_spec.rb new/spec/factory_spec.rb
--- old/spec/factory_spec.rb 2022-07-01 11:53:25.000000000 +0200
+++ new/spec/factory_spec.rb 2022-07-25 09:34:23.000000000 +0200
@@ -474,6 +474,10 @@
expect(roundtrip(:symbol)).to be :symbol
end
+ it 'works with empty symbol' do
+ expect(roundtrip(:"")).to be :""
+ end
+
it 'preserves encoding for ASCII symbols' do
expect(:symbol.encoding).to be Encoding::US_ASCII
expect(roundtrip(:symbol)).to be :symbol