mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
ruby: remove init_stack, adopt rb_gc_mark_maybe
This commit is contained in:
parent
1f18af4395
commit
87835a4e60
3 changed files with 20 additions and 13 deletions
|
|
@ -202,6 +202,21 @@ class MessagePackTestFormat < Test::Unit::TestCase
|
|||
# #check_map 5, (1<<32)-1 # memory error
|
||||
# end
|
||||
|
||||
it "gc mark" do
|
||||
obj = [{["a","b"]=>["c","d"]}, ["e","f"], "d"]
|
||||
pac = MessagePack::Unpacker.new
|
||||
parsed = 0
|
||||
obj.to_msgpack.split(//).each do |b|
|
||||
pac.feed(b)
|
||||
pac.each {|o|
|
||||
assert_equal(obj, o)
|
||||
parsed += 1
|
||||
}
|
||||
GC.start
|
||||
end
|
||||
assert_equal(parsed, 1)
|
||||
end
|
||||
|
||||
private
|
||||
def check(len, obj)
|
||||
v = obj.to_msgpack
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue