msgpack 0.4.2-mswin32 → 0.4.3-mswin32

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
1
  require 'mkmf'
2
- $CFLAGS << " -I.. -Wall -O4"
2
+ require './version.rb'
3
+ $CFLAGS << %[ -I.. -Wall -O4 -DMESSAGEPACK_VERSION=\\"#{MessagePack::VERSION}\\"]
3
4
  create_makefile('msgpack')
4
5
 
@@ -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
-
@@ -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.unpack_limit(data, offset, limit) -> next offset
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.unpack(data, offset) -> next offset
671
+ * unpacker.execute(data, offset) -> next offset
664
672
  *
665
673
  * Deserializes one object over the specified buffer from _offset_ bytes.
666
674
  *
@@ -0,0 +1,3 @@
1
+ module MessagePack
2
+ VERSION = "0.4.3"
3
+ end
Binary file
Binary file
@@ -5,3 +5,4 @@ rescue LoadError
5
5
  require File.dirname(__FILE__) + '/../lib/msgpack'
6
6
  end
7
7
 
8
+ #GC.stress = true
@@ -276,6 +276,10 @@ class MessagePackTestPackUnpack < Test::Unit::TestCase
276
276
  assert_equal(parsed, num)
277
277
  end
278
278
 
279
+ it "MessagePack::VERSION constant" do
280
+ p MessagePack::VERSION
281
+ end
282
+
279
283
  private
280
284
  def check(len, obj)
281
285
  v = obj.to_msgpack
metadata CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  segments:
5
5
  - 0
6
6
  - 4
7
- - 2
8
- version: 0.4.2
7
+ - 3
8
+ version: 0.4.3
9
9
  platform: mswin32
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-03 00:00:00 +09:00
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