nosj 0.4.0-x86_64-linux → 0.4.1-x86_64-linux
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +44 -0
- data/README.md +2 -1
- data/lib/nosj/3.3/nosj.so +0 -0
- data/lib/nosj/3.4/nosj.so +0 -0
- data/lib/nosj/4.0/nosj.so +0 -0
- data/lib/nosj/version.rb +1 -1
- data/lib/nosj.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1b1ee57c8d059a5906baba48a25a9cd0ddb58c259110e62b6ce6fe3ba4377e0f
|
|
4
|
+
data.tar.gz: 312af7ca03bb1ea8bf65d8f55d68d4e5a49f8ebccc512246cd14b6652ddf6f09
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7f5cec4abab64a013bddbee26c0813750c3d66942dcb94c50c54f499e0d34e5515b34ffe8f2e4cf1ebc6e4c3647604120e3003194f4f87637d8230314e4eecfc
|
|
7
|
+
data.tar.gz: 7916c28d532c41a458d8b0b6aa7e6d37a411574728a0b44e7d526dd397bdd6ce8627060a3255ce4f7685931ee778f67c11fa206af97df9d432e1929d89c168ba
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
## [0.4.1] - 2026-09-25
|
|
2
|
+
|
|
3
|
+
- Fixed a crash in `NOSJ.generate`: an object whose `to_json` or
|
|
4
|
+
`to_s` shrank the array being generated (for example with
|
|
5
|
+
`Array#clear`) made the generator read freed memory, usually a
|
|
6
|
+
segfault. The array length is now re-read for every element, like
|
|
7
|
+
the json gem, so elements a callback appends are emitted too.
|
|
8
|
+
- Fixed memory corruption in `NOSJ.splice`: a replacement value whose
|
|
9
|
+
`to_json` modified the source string, deduplicated a frozen String
|
|
10
|
+
subclass (`-str`), or removed entries from the edits hash could make
|
|
11
|
+
splice read freed memory, copying unrelated heap bytes into the
|
|
12
|
+
result or crashing. All values are now generated before the source
|
|
13
|
+
is read.
|
|
14
|
+
- Fixed `NOSJ.lazy` and `NOSJ.each_line` reading freed memory when the
|
|
15
|
+
source is a frozen String subclass (such as
|
|
16
|
+
`ActiveSupport::SafeBuffer`) or a frozen string carrying instance
|
|
17
|
+
variables, and it is deduplicated with `-str` while the lazy
|
|
18
|
+
document is alive or between lines: Ruby swaps such a string's
|
|
19
|
+
buffer, and the old one kept being read (wrong values, or a crash).
|
|
20
|
+
- Fixed a memory leak in `NOSJ.generate` and `NOSJ.write_file`: an
|
|
21
|
+
exception raised by user code the generator calls bypassed its
|
|
22
|
+
cleanup and leaked its output buffer (megabytes per call after large
|
|
23
|
+
documents). Affected: a raising `respond_to?` or
|
|
24
|
+
`respond_to_missing?`, a raising `to_s` on an encoding-conversion
|
|
25
|
+
error, a raising autoload of `JSON::Fragment` (strict and Rails
|
|
26
|
+
modes), and a raising `Errno` constructor for a failed write. The
|
|
27
|
+
exception still propagates unchanged.
|
|
28
|
+
- Fixed: after a `NoMemoryError` in the middle of a parse (or
|
|
29
|
+
`minify`/`reformat`), the next call on that thread aborted the whole
|
|
30
|
+
process. Per-thread parser state is now recovered instead.
|
|
31
|
+
- `NOSJ::Lazy` nodes now take part in generational GC: holding many
|
|
32
|
+
nodes no longer slows down every minor GC (200,000 live nodes: 2.9 ms
|
|
33
|
+
per minor GC before, 0.1 ms now), and they are freed immediately
|
|
34
|
+
when collected.
|
|
35
|
+
- Fixed: lazy documents opened with `allow_trailing_comma: true` or
|
|
36
|
+
`allow_nan: true` could not be walked. `size`, `keys`, `each`, and
|
|
37
|
+
any lookup that missed or stepped over a trailing comma or a `NaN`
|
|
38
|
+
raised `NOSJ::ParserError`, even though `value` worked.
|
|
39
|
+
- `NOSJ.at_pointer`, `NOSJ.at_pointers`, and `NOSJ.at_pointer_file`
|
|
40
|
+
now honor `allow_nan` and `allow_trailing_comma` while resolving the
|
|
41
|
+
pointer, not only when materializing the matched value.
|
|
42
|
+
- Updated the nosj crate to 0.2.2.
|
|
43
|
+
- Updated dependencies, Magnus bumped to 0.9.0.
|
|
44
|
+
|
|
1
45
|
## [0.4.0] - 2026-09-05
|
|
2
46
|
|
|
3
47
|
- Ractors: on Ruby 4.0+, `NOSJ.parse`, `NOSJ.generate`, and every
|
data/README.md
CHANGED
|
@@ -151,7 +151,8 @@ Example: an early field resolves in ~0.35µs where `JSON.parse(json).dig(...)`
|
|
|
151
151
|
costs ~980µs on the same document—three orders of magnitude. A field
|
|
152
152
|
at the far end of a 570 KB document costs ~71µs, still 13× faster
|
|
153
153
|
than parse-then-dig. Misses return nil; matched subtrees materialize
|
|
154
|
-
with the same options as `parse` (`symbolize_names:`, `freeze:`)
|
|
154
|
+
with the same options as `parse` (`symbolize_names:`, `freeze:`), and
|
|
155
|
+
`allow_nan:`/`allow_trailing_comma:` govern the walk to them too.
|
|
155
156
|
|
|
156
157
|
### Files API
|
|
157
158
|
|
data/lib/nosj/3.3/nosj.so
CHANGED
|
Binary file
|
data/lib/nosj/3.4/nosj.so
CHANGED
|
Binary file
|
data/lib/nosj/4.0/nosj.so
CHANGED
|
Binary file
|
data/lib/nosj/version.rb
CHANGED
data/lib/nosj.rb
CHANGED
|
@@ -205,7 +205,8 @@ module NOSJ
|
|
|
205
205
|
|
|
206
206
|
# Partial parsing by JSON Pointer (with the standard +~0+/+~1+
|
|
207
207
|
# escapes). The matched subtree materializes under the same options
|
|
208
|
-
# as {.parse}
|
|
208
|
+
# as {.parse}; +allow_nan+ and +allow_trailing_comma+ also govern the
|
|
209
|
+
# walk to it.
|
|
209
210
|
#
|
|
210
211
|
# @example
|
|
211
212
|
# NOSJ.at_pointer(json, "/users/3/name") #=> "grace" or nil
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nosj
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Yaroslav Markin
|
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
67
|
version: 3.3.11
|
|
68
68
|
requirements: []
|
|
69
|
-
rubygems_version: 4.0.
|
|
69
|
+
rubygems_version: 4.0.20
|
|
70
70
|
specification_version: 4
|
|
71
71
|
summary: An extremely fast JSON parser and generator for Ruby, written in Rust and
|
|
72
72
|
SIMD-accelerated on every platform.
|