oj 1.2.12 → 1.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of oj might be problematic. Click here for more details.
- data/README.md +4 -0
- data/ext/oj/fast.c +1 -1
- data/lib/oj/version.rb +1 -1
- data/test/oj-test/test.rb +4 -7
- metadata +2 -2
data/README.md
CHANGED
@@ -32,6 +32,10 @@ A fast JSON parser and Object marshaller as a Ruby gem.
|
|
32
32
|
|
33
33
|
## <a name="release">Release Notes</a>
|
34
34
|
|
35
|
+
### Release 1.2.13
|
36
|
+
|
37
|
+
- Fixed double free bug in Oj::Doc that showed up for larger documents.
|
38
|
+
|
35
39
|
### Release 1.2.12
|
36
40
|
|
37
41
|
- Fixed GC bug in Oj::Doc, the fast parser.
|
data/ext/oj/fast.c
CHANGED
@@ -847,7 +847,7 @@ parse_json(VALUE clas, char *json, int given, int allocated) {
|
|
847
847
|
rb_gc_unregister_address(&doc->self);
|
848
848
|
DATA_PTR(doc->self) = 0;
|
849
849
|
doc_free(pi.doc);
|
850
|
-
if (allocated) {
|
850
|
+
if (allocated && 0 != ex) { // will jump so caller will not free
|
851
851
|
xfree(json);
|
852
852
|
}
|
853
853
|
} else {
|
data/lib/oj/version.rb
CHANGED
data/test/oj-test/test.rb
CHANGED
@@ -81,8 +81,6 @@ class Bid
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
#GC.disable
|
85
|
-
|
86
84
|
class BidResponseParser
|
87
85
|
REQUIRED_ATTRIBUTES = [:id, :impid, :price].freeze
|
88
86
|
|
@@ -92,8 +90,8 @@ class BidResponseParser
|
|
92
90
|
end
|
93
91
|
|
94
92
|
def self.extract_fast(json)
|
95
|
-
|
96
|
-
|
93
|
+
bid = nil
|
94
|
+
Oj::Doc.open(json) do |doc|
|
97
95
|
bid = Bid.new
|
98
96
|
|
99
97
|
# bid-response object
|
@@ -128,10 +126,9 @@ class BidResponseParser
|
|
128
126
|
end
|
129
127
|
|
130
128
|
bid.price = doc.fetch("#{bid_path}/price").to_f
|
129
|
+
end
|
131
130
|
|
132
|
-
|
133
|
-
return bid
|
134
|
-
#end
|
131
|
+
return bid
|
135
132
|
end
|
136
133
|
end
|
137
134
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-08 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! 'The fastest JSON parser and object serializer. '
|
15
15
|
email: peter@ohler.com
|