Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ext/java/org/msgpack/jruby/Factory.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public IRubyObject dup() {
Factory clone = (Factory)super.dup();
clone.extensionRegistry = extensionRegistry();
clone.hasSymbolExtType = hasSymbolExtType;
clone.hasBigIntExtType = hasBigIntExtType;
return clone;
}

Expand Down
4 changes: 4 additions & 0 deletions ext/msgpack/factory_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ static VALUE Factory_dup(VALUE self)
msgpack_factory_t *fc = Factory_get(self);
msgpack_factory_t *cloned_fc = Factory_get(clone);

cloned_fc->has_bigint_ext_type = fc->has_bigint_ext_type;
cloned_fc->has_symbol_ext_type = fc->has_symbol_ext_type;
cloned_fc->optimized_symbol_ext_type = fc->optimized_symbol_ext_type;
cloned_fc->symbol_ext_type = fc->symbol_ext_type;
cloned_fc->pkrg = fc->pkrg;
msgpack_unpacker_ext_registry_borrow(fc->ukrg, &cloned_fc->ukrg);
msgpack_packer_ext_registry_dup(clone, &fc->pkrg, &cloned_fc->pkrg);
Expand Down Expand Up @@ -230,6 +233,7 @@ static VALUE Factory_register_type_internal(VALUE self, VALUE rb_ext_type, VALUE
}

if(ext_module == rb_cSymbol) {
fc->symbol_ext_type = ext_type;
if(NIL_P(options) || RTEST(rb_hash_aref(options, ID2SYM(rb_intern("packer"))))) {
fc->has_symbol_ext_type = true;
}
Expand Down
4 changes: 2 additions & 2 deletions spec/factory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,10 @@ def roundtrip(object, options = nil)
before do
skip if IS_JRUBY # JRuby implementation doesn't support the optimized symbols unpacker for now
subject.register_type(
0x00,
0x01,
::Symbol,
packer: :to_msgpack_ext,
unpacker: :from_msgpack_ext,
unpacker: ->(_) { raise "symbol unpacking not optimized" },
optimized_symbols_parsing: true,
)
end
Expand Down
Loading