piko-lite-mod 0.0.1

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 piko-lite-mod might be problematic. Click here for more details.

Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/json-2.21.1/BSDL +22 -0
  3. data/json-2.21.1/CHANGES.md +810 -0
  4. data/json-2.21.1/COPYING +56 -0
  5. data/json-2.21.1/LEGAL +20 -0
  6. data/json-2.21.1/README.md +308 -0
  7. data/json-2.21.1/ext/json/ext/fbuffer/fbuffer.h +259 -0
  8. data/json-2.21.1/ext/json/ext/generator/extconf.rb +19 -0
  9. data/json-2.21.1/ext/json/ext/generator/generator.c +2066 -0
  10. data/json-2.21.1/ext/json/ext/json.h +183 -0
  11. data/json-2.21.1/ext/json/ext/parser/extconf.rb +37 -0
  12. data/json-2.21.1/ext/json/ext/parser/parser.c +2917 -0
  13. data/json-2.21.1/ext/json/ext/simd/conf.rb +24 -0
  14. data/json-2.21.1/ext/json/ext/simd/simd.h +208 -0
  15. data/json-2.21.1/ext/json/ext/vendor/fast_float_parser.h +814 -0
  16. data/json-2.21.1/ext/json/ext/vendor/fpconv.c +480 -0
  17. data/json-2.21.1/ext/json/ext/vendor/jeaiii-ltoa.h +267 -0
  18. data/json-2.21.1/json.gemspec +62 -0
  19. data/json-2.21.1/lib/json/add/bigdecimal.rb +58 -0
  20. data/json-2.21.1/lib/json/add/complex.rb +51 -0
  21. data/json-2.21.1/lib/json/add/core.rb +13 -0
  22. data/json-2.21.1/lib/json/add/date.rb +54 -0
  23. data/json-2.21.1/lib/json/add/date_time.rb +67 -0
  24. data/json-2.21.1/lib/json/add/exception.rb +49 -0
  25. data/json-2.21.1/lib/json/add/ostruct.rb +54 -0
  26. data/json-2.21.1/lib/json/add/range.rb +54 -0
  27. data/json-2.21.1/lib/json/add/rational.rb +49 -0
  28. data/json-2.21.1/lib/json/add/regexp.rb +48 -0
  29. data/json-2.21.1/lib/json/add/set.rb +48 -0
  30. data/json-2.21.1/lib/json/add/string.rb +35 -0
  31. data/json-2.21.1/lib/json/add/struct.rb +52 -0
  32. data/json-2.21.1/lib/json/add/symbol.rb +52 -0
  33. data/json-2.21.1/lib/json/add/time.rb +52 -0
  34. data/json-2.21.1/lib/json/common.rb +1182 -0
  35. data/json-2.21.1/lib/json/ext/generator/state.rb +104 -0
  36. data/json-2.21.1/lib/json/ext.rb +71 -0
  37. data/json-2.21.1/lib/json/generic_object.rb +67 -0
  38. data/json-2.21.1/lib/json/truffle_ruby/generator.rb +790 -0
  39. data/json-2.21.1/lib/json/version.rb +5 -0
  40. data/json-2.21.1/lib/json.rb +841 -0
  41. data/piko-lite-mod.gemspec +11 -0
  42. metadata +80 -0
@@ -0,0 +1,183 @@
1
+ #ifndef _JSON_H_
2
+ #define _JSON_H_
3
+
4
+ #include "ruby.h"
5
+ #include "ruby/encoding.h"
6
+ #include <stdint.h>
7
+
8
+ #ifndef RBIMPL_ASSERT_OR_ASSUME
9
+ # define RBIMPL_ASSERT_OR_ASSUME(x)
10
+ #endif
11
+
12
+ #if defined(RUBY_DEBUG) && RUBY_DEBUG
13
+ # define JSON_ASSERT RUBY_ASSERT
14
+ # ifndef JSON_DEBUG
15
+ # define JSON_DEBUG 1
16
+ # endif
17
+ #else
18
+ # ifdef JSON_DEBUG
19
+ # include <assert.h>
20
+ # define JSON_ASSERT(x) assert(x)
21
+ # else
22
+ # define JSON_ASSERT(x)
23
+ # endif
24
+ #endif
25
+
26
+ #ifdef JSON_DEBUG
27
+ # define JSON_UNREACHABLE_RETURN(val) rb_bug("Unreachable")
28
+ #else
29
+ # define JSON_UNREACHABLE_RETURN UNREACHABLE_RETURN
30
+ #endif
31
+
32
+ /* shims */
33
+
34
+ #ifndef RUBY_TYPED_THREAD_SAFE_FREE
35
+ #define RUBY_TYPED_THREAD_SAFE_FREE RUBY_TYPED_FREE_IMMEDIATELY
36
+ #endif
37
+
38
+ #ifndef UNDEF_P
39
+ #define UNDEF_P(val) (val == Qundef)
40
+ #endif
41
+
42
+ #if SIZEOF_UINT64_T == SIZEOF_LONG_LONG
43
+ # define INT64T2NUM(x) LL2NUM(x)
44
+ # define UINT64T2NUM(x) ULL2NUM(x)
45
+ #elif SIZEOF_UINT64_T == SIZEOF_LONG
46
+ # define INT64T2NUM(x) LONG2NUM(x)
47
+ # define UINT64T2NUM(x) ULONG2NUM(x)
48
+ #else
49
+ # error No uint64_t conversion
50
+ #endif
51
+
52
+ /* This is the fallback definition from Ruby 3.4 */
53
+ #ifndef RBIMPL_STDBOOL_H
54
+ #if defined(__cplusplus)
55
+ # if defined(HAVE_STDBOOL_H) && (__cplusplus >= 201103L)
56
+ # include <cstdbool>
57
+ # endif
58
+ #elif defined(HAVE_STDBOOL_H)
59
+ # include <stdbool.h>
60
+ #elif !defined(HAVE__BOOL)
61
+ typedef unsigned char _Bool;
62
+ # define bool _Bool
63
+ # define true ((_Bool)+1)
64
+ # define false ((_Bool)+0)
65
+ # define __bool_true_false_are_defined
66
+ #endif
67
+ #endif
68
+
69
+ #ifndef HAVE_RUBY_XFREE_SIZED
70
+ static inline void ruby_xfree_sized(void *ptr, size_t oldsize)
71
+ {
72
+ ruby_xfree(ptr);
73
+ }
74
+
75
+ static inline void *ruby_xrealloc2_sized(void *ptr, size_t new_elems, size_t elem_size, size_t old_elems)
76
+ {
77
+ return ruby_xrealloc2(ptr, new_elems, elem_size);
78
+ }
79
+ #endif
80
+
81
+ # define JSON_SIZED_REALLOC_N(v, T, m, n) \
82
+ ((v) = (T *)ruby_xrealloc2_sized((void *)(v), (m), sizeof(T), (n)))
83
+
84
+ # define JSON_SIZED_FREE(v) ruby_xfree_sized((void *)(v), sizeof(*(v)))
85
+ # define JSON_SIZED_FREE_N(v, n) ruby_xfree_sized((void *)(v), sizeof(*(v)) * (n))
86
+
87
+ #ifndef HAVE_RB_EXT_RACTOR_SAFE
88
+ # undef RUBY_TYPED_FROZEN_SHAREABLE
89
+ # define RUBY_TYPED_FROZEN_SHAREABLE 0
90
+ #endif
91
+
92
+ #ifdef RUBY_TYPED_EMBEDDABLE
93
+ # define HAVE_RUBY_TYPED_EMBEDDABLE 1
94
+ #else
95
+ # ifdef HAVE_CONST_RUBY_TYPED_EMBEDDABLE
96
+ # define RUBY_TYPED_EMBEDDABLE RUBY_TYPED_EMBEDDABLE
97
+ # define HAVE_RUBY_TYPED_EMBEDDABLE 1
98
+ # else
99
+ # define RUBY_TYPED_EMBEDDABLE 0
100
+ # endif
101
+ #endif
102
+
103
+ #ifndef NORETURN
104
+ #if defined(__has_attribute) && __has_attribute(noreturn)
105
+ #define NORETURN(x) __attribute__((noreturn)) x
106
+ #else
107
+ #define NORETURN(x) x
108
+ #endif
109
+ #endif
110
+
111
+ #ifndef NOINLINE
112
+ #if defined(__has_attribute) && __has_attribute(noinline)
113
+ #define NOINLINE(x) __attribute__((noinline)) x
114
+ #else
115
+ #define NOINLINE(x) x
116
+ #endif
117
+ #endif
118
+
119
+ #ifndef ALWAYS_INLINE
120
+ #if defined(__has_attribute) && __has_attribute(always_inline)
121
+ #define ALWAYS_INLINE(x) inline __attribute__((always_inline)) x
122
+ #else
123
+ #define ALWAYS_INLINE(x) inline x
124
+ #endif
125
+ #endif
126
+
127
+ #ifndef RB_UNLIKELY
128
+ #define RB_UNLIKELY(expr) expr
129
+ #endif
130
+
131
+ #ifndef RB_LIKELY
132
+ #define RB_LIKELY(expr) expr
133
+ #endif
134
+
135
+ #ifndef MAYBE_UNUSED
136
+ # define MAYBE_UNUSED(x) x
137
+ #endif
138
+
139
+ #ifdef RUBY_DEBUG
140
+ #ifndef JSON_DEBUG
141
+ #define JSON_DEBUG RUBY_DEBUG
142
+ #endif
143
+ #endif
144
+
145
+ #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && INTPTR_MAX == INT64_MAX
146
+ #define JSON_CPU_LITTLE_ENDIAN_64BITS 1
147
+ #else
148
+ #define JSON_CPU_LITTLE_ENDIAN_64BITS 0
149
+ #endif
150
+
151
+ #ifdef JSON_TRUFFLERUBY_RB_CATCH_BUG
152
+
153
+ #undef RB_BLOCK_CALL_FUNC_ARGLIST
154
+ #define RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, func_args) VALUE func_args
155
+
156
+ NORETURN(static inline) void json_rb_throw_obj(VALUE tag, VALUE obj)
157
+ {
158
+ VALUE exc = rb_exc_new_str(rb_eException, rb_utf8_str_new_cstr("throw_workaround"));
159
+ rb_ivar_set(exc, rb_intern("@throw_tag"), tag);
160
+ rb_ivar_set(exc, rb_intern("@throw_obj"), obj);
161
+ rb_exc_raise(exc);
162
+ }
163
+ #define rb_throw_obj json_rb_throw_obj
164
+
165
+ static inline VALUE json_rb_catch_obj(VALUE tag, VALUE (*func)(VALUE args), VALUE func_args)
166
+ {
167
+ int status;
168
+ VALUE result = rb_protect(func, func_args, &status);
169
+ if (status) {
170
+ VALUE exc = rb_errinfo();
171
+ if (tag == rb_ivar_get(exc, rb_intern("@throw_tag"))) {
172
+ rb_set_errinfo(Qnil);
173
+ return rb_ivar_get(exc, rb_intern("@throw_obj"));
174
+ }
175
+ rb_jump_tag(status);
176
+ }
177
+ return result;
178
+ }
179
+ #define rb_catch_obj json_rb_catch_obj
180
+
181
+ #endif // JSON_TRUFFLERUBY_RB_CATCH_BUG
182
+
183
+ #endif // _JSON_H_
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ require 'mkmf'
3
+
4
+ $defs << "-DJSON_DEBUG" if ENV.fetch("JSON_DEBUG", "0") != "0"
5
+
6
+ if RUBY_ENGINE == 'truffleruby' && RUBY_ENGINE_VERSION < '40.0'
7
+ # Ref: https://github.com/truffleruby/truffleruby/issues/4329
8
+ # Ref: https://github.com/truffleruby/truffleruby/pull/4333
9
+ $defs << "-DJSON_TRUFFLERUBY_RB_CATCH_BUG"
10
+ end
11
+
12
+ have_func("rb_enc_interned_str", "ruby/encoding.h") # RUBY_VERSION >= 3.0
13
+ have_func("rb_str_to_interned_str", "ruby.h") # RUBY_VERSION >= 3.0
14
+ have_func("rb_hash_new_capa", "ruby.h") # RUBY_VERSION >= 3.2
15
+ have_func("rb_hash_bulk_insert", "ruby.h") # Missing on TruffleRuby
16
+ have_func("ruby_xfree_sized", "ruby.h") # RUBY_VERSION >= 4.1
17
+
18
+ if have_header("x86intrin.h")
19
+ have_func("_lzcnt_u64", "x86intrin.h")
20
+ end
21
+
22
+ if have_header("intrin.h")
23
+ have_func("__lzcnt64", "intrin.h")
24
+ have_func("_BitScanReverse64", "intrin.h")
25
+ end
26
+
27
+ if RUBY_ENGINE == "ruby"
28
+ have_const("RUBY_TYPED_EMBEDDABLE", "ruby.h") # RUBY_VERSION >= 3.3
29
+ end
30
+
31
+ append_cflags("-std=c99")
32
+
33
+ if enable_config('parser-use-simd', default=!ENV["JSON_DISABLE_SIMD"])
34
+ load __dir__ + "/../simd/conf.rb"
35
+ end
36
+
37
+ create_makefile 'json/ext/parser'