bson_ext 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/cbson/cbson.c +8 -1
- data/ext/cbson/version.h +1 -1
- metadata +8 -5
data/ext/cbson/cbson.c
CHANGED
@@ -162,6 +162,7 @@ static void write_utf8(buffer_t buffer, VALUE string, char check_null) {
|
|
162
162
|
*buffer = malloc(vslength); \
|
163
163
|
_snprintf(*buffer, vslength, "%d", i); \
|
164
164
|
}
|
165
|
+
#define FREE_INTSTRING(buffer) free(buffer)
|
165
166
|
#else
|
166
167
|
#define INT2STRING(buffer, i) \
|
167
168
|
{ \
|
@@ -169,9 +170,15 @@ static void write_utf8(buffer_t buffer, VALUE string, char check_null) {
|
|
169
170
|
*buffer = malloc(vslength); \
|
170
171
|
snprintf(*buffer, vslength, "%d", i); \
|
171
172
|
}
|
173
|
+
#define FREE_INTSTRING(buffer) free(buffer)
|
172
174
|
#endif
|
173
175
|
#else
|
174
176
|
#define INT2STRING(buffer, i) asprintf(buffer, "%d", i);
|
177
|
+
#ifdef USING_SYSTEM_ALLOCATOR_LIBRARY /* Ruby Enterprise Edition with tcmalloc */
|
178
|
+
#define FREE_INTSTRING(buffer) system_free(buffer)
|
179
|
+
#else
|
180
|
+
#define FREE_INTSTRING(buffer) free(buffer)
|
181
|
+
#endif
|
175
182
|
#endif
|
176
183
|
|
177
184
|
#ifndef RREGEXP_SRC
|
@@ -320,7 +327,7 @@ static int write_element(VALUE key, VALUE value, VALUE extra, int allow_id) {
|
|
320
327
|
INT2STRING(&name, i);
|
321
328
|
key = rb_str_new2(name);
|
322
329
|
write_element_with_id(key, rb_ary_entry(value, i), pack_extra(buffer, check_keys));
|
323
|
-
|
330
|
+
FREE_INTSTRING(name);
|
324
331
|
}
|
325
332
|
|
326
333
|
// write null byte and fill in length
|
data/ext/cbson/version.h
CHANGED
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bson_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
9
|
+
- 2
|
10
|
+
version: 1.2.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Mike Dirolf
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-15 00:00:00 -05:00
|
18
19
|
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
@@ -50,6 +51,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
50
51
|
requirements:
|
51
52
|
- - ">="
|
52
53
|
- !ruby/object:Gem::Version
|
54
|
+
hash: 3
|
53
55
|
segments:
|
54
56
|
- 0
|
55
57
|
version: "0"
|
@@ -58,13 +60,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
60
|
requirements:
|
59
61
|
- - ">="
|
60
62
|
- !ruby/object:Gem::Version
|
63
|
+
hash: 3
|
61
64
|
segments:
|
62
65
|
- 0
|
63
66
|
version: "0"
|
64
67
|
requirements: []
|
65
68
|
|
66
69
|
rubyforge_project:
|
67
|
-
rubygems_version: 1.
|
70
|
+
rubygems_version: 1.4.1
|
68
71
|
signing_key:
|
69
72
|
specification_version: 3
|
70
73
|
summary: C extensions for Ruby BSON.
|