yeptris 0.6.5.2-aarch64-linux → 0.6.5.4-aarch64-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/ext/yeptris_native/json_ruby.c +15 -4
- data/lib/yeptris/ffi.rb +12 -0
- data/lib/yeptris/native.so +0 -0
- data/lib/yeptris.rb +1 -1
- metadata +4 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29523b44d62fa7129c5ab4fc6101e507953136a25568c4ba10ca7996cdcdc94d
|
|
4
|
+
data.tar.gz: d06d501911f9d886ada35fe94b53002e5fe46b3fd1d8dc32d08185eb9acf6a1b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30a87b83e11b11311be8d2bdbbd296aa894663c71d6575517e28e6e6cd1decbb2cf04512da6d7319390884cda374f380b892c1fb3d6d4b6c0a8a39815ab93ee4
|
|
7
|
+
data.tar.gz: c40473a47a9b68b35f42c592dbb06a0cdc4417cd426c66dea192d8b0f78b2a024bdad0063ba6458c249c185334eebf2b7878b9331f30c85874d302421fc5ebcc
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
|
|
1
2
|
/* json_ruby.c — fused RFC 8259 → Ruby VALUE (TODO.restructure/22). */
|
|
2
3
|
#include <ruby.h>
|
|
4
|
+
/* rb_hash_new_capa is Ruby 3.2+; older Rubies grow dynamically (the
|
|
5
|
+
* FFI fallback stays correct on every minor either way). */
|
|
6
|
+
#if RUBY_API_VERSION_MAJOR > 3 || (RUBY_API_VERSION_MAJOR == 3 && RUBY_API_VERSION_MINOR >= 2)
|
|
7
|
+
#define HASH_NEW_CAPA(n) rb_hash_new_capa(n)
|
|
8
|
+
#else
|
|
9
|
+
#define HASH_NEW_CAPA(n) rb_hash_new()
|
|
10
|
+
#endif
|
|
11
|
+
|
|
3
12
|
#include <ruby/encoding.h>
|
|
4
13
|
#include <ruby/intern.h>
|
|
5
14
|
#include <stdlib.h>
|
|
@@ -151,7 +160,7 @@ static int yep_ins_mode = YEP_INS_BULK;
|
|
|
151
160
|
static VALUE jr_object(jr* j) {
|
|
152
161
|
j->i++; j->depth++;
|
|
153
162
|
if (yep_shape_mode == YEP_SHAPE_PRE) {
|
|
154
|
-
VALUE h =
|
|
163
|
+
VALUE h = HASH_NEW_CAPA(8);
|
|
155
164
|
jr_ws(j);
|
|
156
165
|
if (j->i < j->len && j->p[j->i] == '}') { j->i++; j->depth--; return h; }
|
|
157
166
|
return jr_object_body(j, h);
|
|
@@ -178,7 +187,7 @@ static VALUE jr_object_body(jr* j, VALUE h_pre) {
|
|
|
178
187
|
VALUE val = jr_value(j);
|
|
179
188
|
if (j->err) goto out;
|
|
180
189
|
if (yep_ins_mode == YEP_INS_ASET || j->strict_dup) {
|
|
181
|
-
VALUE h = h_pre == Qundef ? (h_pre =
|
|
190
|
+
VALUE h = h_pre == Qundef ? (h_pre = HASH_NEW_CAPA(8)) : h_pre;
|
|
182
191
|
if (j->strict_dup && !NIL_P(rb_hash_aref(h, key))) {
|
|
183
192
|
j->err = -3;
|
|
184
193
|
j->dup_key = key;
|
|
@@ -204,13 +213,13 @@ static VALUE jr_object_body(jr* j, VALUE h_pre) {
|
|
|
204
213
|
j->err = -2; goto out;
|
|
205
214
|
}
|
|
206
215
|
if (yep_ins_mode == YEP_INS_BULK) {
|
|
207
|
-
VALUE h = (h_pre == Qundef) ?
|
|
216
|
+
VALUE h = (h_pre == Qundef) ? HASH_NEW_CAPA((long)(pn / 2)) : h_pre;
|
|
208
217
|
rb_hash_bulk_insert((long)pn, (const VALUE*)pv, h);
|
|
209
218
|
if (pv != pairs) { free(pv); }
|
|
210
219
|
j->depth--;
|
|
211
220
|
return h;
|
|
212
221
|
}
|
|
213
|
-
if (h_pre == Qundef) { h_pre =
|
|
222
|
+
if (h_pre == Qundef) { h_pre = HASH_NEW_CAPA(8); }
|
|
214
223
|
out:
|
|
215
224
|
if (pv != pairs) { free(pv); (void)heap_cap; }
|
|
216
225
|
if (j->err) return Qnil;
|
|
@@ -309,6 +318,8 @@ void yep_rb_set_gc_mode(int mode) {
|
|
|
309
318
|
* same scan kernels through the null vtable. Decomposes scan vs
|
|
310
319
|
* materialize cost. Returns seconds for n iterations. */
|
|
311
320
|
#include <time.h>
|
|
321
|
+
|
|
322
|
+
|
|
312
323
|
double yep_rb_scan_time(const char* p, size_t len, int n) {
|
|
313
324
|
static const YeptrisVisitVTable none = {0};
|
|
314
325
|
struct timespec t0, t1;
|
data/lib/yeptris/ffi.rb
CHANGED
|
@@ -28,6 +28,18 @@ module Yeptris
|
|
|
28
28
|
MSG
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
# :c_free (:free, line ~240) must resolve against the C runtime.
|
|
32
|
+
# Linux/macOS fall through to the process symbol table, but
|
|
33
|
+
# Windows has no such fallback — without LIBC attached the
|
|
34
|
+
# ffi.rb load DIED at that attach (leaving every later constant
|
|
35
|
+
# undefined: the mingw gem's missing NODE_* / #318).
|
|
36
|
+
begin
|
|
37
|
+
ffi_lib FFI::Library::LIBC
|
|
38
|
+
rescue StandardError
|
|
39
|
+
# no LIBC handle: the c_free attach below surfaces the failure
|
|
40
|
+
# exactly where it used to, on non-Windows platforms only
|
|
41
|
+
end
|
|
42
|
+
|
|
31
43
|
typedef :pointer, :yeptris_document
|
|
32
44
|
typedef :pointer, :yeptris_node
|
|
33
45
|
typedef :pointer, :yeptris_status_out
|
data/lib/yeptris/native.so
CHANGED
|
Binary file
|
data/lib/yeptris.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Yeptris
|
|
4
4
|
# The gem's version lives in the parent namespace's file — the last
|
|
5
5
|
# internal require (yeptris/version) retired with it.
|
|
6
|
-
VERSION = "0.6.5.
|
|
6
|
+
VERSION = "0.6.5.4".freeze
|
|
7
7
|
# The error hierarchy lives in THIS file (the parent namespace's
|
|
8
8
|
# own file): nested constants do not trigger a parent-constant
|
|
9
9
|
# autoload, and the law forbids internal requires — defining the
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yeptris
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.5.
|
|
4
|
+
version: 0.6.5.4
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: ffi
|
|
@@ -65,7 +64,6 @@ metadata:
|
|
|
65
64
|
homepage_uri: https://github.com/leptris/yeptris
|
|
66
65
|
source_code_uri: https://github.com/leptris/yeptris
|
|
67
66
|
changelog_uri: https://github.com/leptris/yeptris/releases
|
|
68
|
-
post_install_message:
|
|
69
67
|
rdoc_options: []
|
|
70
68
|
require_paths:
|
|
71
69
|
- lib
|
|
@@ -73,15 +71,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
73
71
|
requirements:
|
|
74
72
|
- - ">="
|
|
75
73
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: '3.
|
|
74
|
+
version: '3.0'
|
|
77
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
76
|
requirements:
|
|
79
77
|
- - ">="
|
|
80
78
|
- !ruby/object:Gem::Version
|
|
81
79
|
version: '0'
|
|
82
80
|
requirements: []
|
|
83
|
-
rubygems_version:
|
|
84
|
-
signing_key:
|
|
81
|
+
rubygems_version: 4.0.21
|
|
85
82
|
specification_version: 4
|
|
86
83
|
summary: 'The YAML counterpart of libleptris: ultra-performance YAML 1.2 for Ruby'
|
|
87
84
|
test_files: []
|