msgpack 0.3.1-x86-mingw32 → 0.3.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Binary file
data/ext/pack.o CHANGED
Binary file
Binary file
@@ -127,6 +127,15 @@ static inline int template_callback_raw(unpack_user* u, const char* b, const cha
127
127
  static VALUE cUnpacker;
128
128
  static VALUE eUnpackError;
129
129
 
130
+ // FIXME slow operation
131
+ static void init_stack(msgpack_unpack_t* mp)
132
+ {
133
+ size_t i;
134
+ for(i=0; i < MSGPACK_MAX_STACK_SIZE; ++i) {
135
+ mp->stack[i].map_key = Qnil; /* GC */
136
+ }
137
+ }
138
+
130
139
  static void MessagePack_Unpacker_free(void* data)
131
140
  {
132
141
  if(data) { free(data); }
@@ -137,7 +146,7 @@ static void MessagePack_Unpacker_mark(msgpack_unpack_t *mp)
137
146
  unsigned int i;
138
147
  for(i=0; i < mp->top; ++i) {
139
148
  rb_gc_mark(mp->stack[i].obj);
140
- rb_gc_mark(mp->stack[i].map_key);
149
+ rb_gc_mark(mp->stack[i].map_key); /* maybe map_key is not initialized */
141
150
  }
142
151
  }
143
152
 
@@ -154,6 +163,7 @@ static VALUE MessagePack_Unpacker_reset(VALUE self)
154
163
  {
155
164
  UNPACKER(self, mp);
156
165
  template_init(mp);
166
+ init_stack(mp);
157
167
  unpack_user u = {0, Qnil};
158
168
  mp->user = u;
159
169
  return self;
@@ -281,6 +291,7 @@ static VALUE MessagePack_unpack_limit(VALUE self, VALUE data, VALUE limit)
281
291
 
282
292
  msgpack_unpack_t mp;
283
293
  template_init(&mp);
294
+ init_stack(&mp);
284
295
  unpack_user u = {0, Qnil};
285
296
  mp.user = u;
286
297
 
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - FURUHASHI Sadayuki
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-04 00:00:00 +09:00
12
+ date: 2009-12-11 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies: []
15
15