msgpack 0.4.2-x86-mingw32 → 0.4.3-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/extconf.rb +2 -1
- data/ext/rbinit.c +3 -1
- data/ext/unpack.c +15 -7
- data/ext/version.rb +3 -0
- data/lib/1.8/msgpack.so +0 -0
- data/lib/1.9/msgpack.so +0 -0
- data/test/test_helper.rb +1 -0
- data/test/test_pack_unpack.rb +4 -0
- metadata +4 -3
data/ext/extconf.rb
CHANGED
data/ext/rbinit.c
CHANGED
@@ -43,7 +43,9 @@ static VALUE mMessagePack;
|
|
43
43
|
void Init_msgpack(void)
|
44
44
|
{
|
45
45
|
mMessagePack = rb_define_module("MessagePack");
|
46
|
+
|
47
|
+
rb_define_const(mMessagePack, "VERSION", rb_str_new2(MESSAGEPACK_VERSION));
|
48
|
+
|
46
49
|
Init_msgpack_unpack(mMessagePack);
|
47
50
|
Init_msgpack_pack(mMessagePack);
|
48
51
|
}
|
49
|
-
|
data/ext/unpack.c
CHANGED
@@ -287,6 +287,7 @@ static void MessagePack_Unpacker_mark(msgpack_unpack_t *mp)
|
|
287
287
|
unsigned int i;
|
288
288
|
rb_gc_mark(mp->user.stream);
|
289
289
|
rb_gc_mark(mp->user.streambuf);
|
290
|
+
rb_gc_mark_maybe(template_data(mp));
|
290
291
|
for(i=0; i < mp->top; ++i) {
|
291
292
|
rb_gc_mark(mp->stack[i].obj);
|
292
293
|
rb_gc_mark_maybe(mp->stack[i].map_key);
|
@@ -297,6 +298,17 @@ static VALUE MessagePack_Unpacker_alloc(VALUE klass)
|
|
297
298
|
{
|
298
299
|
VALUE obj;
|
299
300
|
msgpack_unpack_t* mp = ALLOC_N(msgpack_unpack_t, 1);
|
301
|
+
|
302
|
+
// rb_gc_mark (not _maybe) is used for following member objects.
|
303
|
+
mp->user.stream = Qnil;
|
304
|
+
mp->user.streambuf = Qnil;
|
305
|
+
|
306
|
+
mp->user.finished = 0;
|
307
|
+
mp->user.offset = 0;
|
308
|
+
mp->user.buffer.size = 0;
|
309
|
+
mp->user.buffer.free = 0;
|
310
|
+
mp->user.buffer.ptr = NULL;
|
311
|
+
|
300
312
|
obj = Data_Wrap_Struct(klass, MessagePack_Unpacker_mark,
|
301
313
|
MessagePack_Unpacker_free, mp);
|
302
314
|
return obj;
|
@@ -343,14 +355,10 @@ static VALUE MessagePack_Unpacker_initialize(int argc, VALUE *argv, VALUE self)
|
|
343
355
|
|
344
356
|
UNPACKER(self, mp);
|
345
357
|
template_init(mp);
|
346
|
-
mp->user.finished = 0;
|
347
|
-
mp->user.offset = 0;
|
348
|
-
mp->user.buffer.size = 0;
|
349
|
-
mp->user.buffer.free = 0;
|
350
|
-
mp->user.buffer.ptr = NULL;
|
351
358
|
mp->user.stream = stream;
|
352
359
|
mp->user.streambuf = rb_str_buf_new(MSGPACK_UNPACKER_BUFFER_RESERVE_SIZE);
|
353
360
|
mp->user.stream_append_method = append_method_of(stream);
|
361
|
+
|
354
362
|
return self;
|
355
363
|
}
|
356
364
|
|
@@ -638,7 +646,7 @@ static VALUE MessagePack_Unpacker_execute_impl(VALUE self, VALUE data,
|
|
638
646
|
* Document-method: MessagePack::Unpacker#execute_limit
|
639
647
|
*
|
640
648
|
* call-seq:
|
641
|
-
* unpacker.
|
649
|
+
* unpacker.execute_limit(data, offset, limit) -> next offset
|
642
650
|
*
|
643
651
|
* Deserializes one object over the specified buffer from _offset_ bytes upto _limit_ bytes.
|
644
652
|
*
|
@@ -660,7 +668,7 @@ static VALUE MessagePack_Unpacker_execute_limit(VALUE self, VALUE data,
|
|
660
668
|
* Document-method: MessagePack::Unpacker#execute
|
661
669
|
*
|
662
670
|
* call-seq:
|
663
|
-
* unpacker.
|
671
|
+
* unpacker.execute(data, offset) -> next offset
|
664
672
|
*
|
665
673
|
* Deserializes one object over the specified buffer from _offset_ bytes.
|
666
674
|
*
|
data/ext/version.rb
ADDED
data/lib/1.8/msgpack.so
CHANGED
Binary file
|
data/lib/1.9/msgpack.so
CHANGED
Binary file
|
data/test/test_helper.rb
CHANGED
data/test/test_pack_unpack.rb
CHANGED
metadata
CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
segments:
|
5
5
|
- 0
|
6
6
|
- 4
|
7
|
-
-
|
8
|
-
version: 0.4.
|
7
|
+
- 3
|
8
|
+
version: 0.4.3
|
9
9
|
platform: x86-mingw32
|
10
10
|
authors:
|
11
11
|
- FURUHASHI Sadayuki
|
@@ -13,7 +13,7 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date: 2010-06-
|
16
|
+
date: 2010-06-29 00:00:00 +09:00
|
17
17
|
default_executable:
|
18
18
|
dependencies: []
|
19
19
|
|
@@ -32,6 +32,7 @@ files:
|
|
32
32
|
- ext/rbinit.c
|
33
33
|
- ext/unpack.c
|
34
34
|
- ext/unpack.h
|
35
|
+
- ext/version.rb
|
35
36
|
- lib/1.8/msgpack.so
|
36
37
|
- lib/1.9/msgpack.so
|
37
38
|
- lib/msgpack.rb
|