oj 3.16.10 → 3.16.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1095d7a176bd19396bd99cf23df33564dbdf983b36a74254085700a12ce4293
4
- data.tar.gz: ef1b5958d6edf181843066dc4b60a93e861779cfa387b88d0f866d642c3e9a6c
3
+ metadata.gz: 6e2053531cd4c7c7b49bf16ddafbfda868e67e66c1bfbec1b06daaa0ba3f1c45
4
+ data.tar.gz: ce029b2f90660922dd8fb335c23463a1fe1d81317d56e48f2cfddc9271de2d15
5
5
  SHA512:
6
- metadata.gz: c396a33f0a2e64282f13a1b834c8804429f97de515dffcf1e8cba852fbe645301c9f6b0e7d64552a795c70e0262e8828f650a1ac9243391af8c07a2ecd621f35
7
- data.tar.gz: 43ddbc0d8f2d5bea7580b0f88fa2c4981a661098f3e041aac6f8185029e2018f99ef33478ebbf62b35c31357f1d48adb25f6889b6049054add214a834e8e696a
6
+ metadata.gz: deb7f1447b5022adad6d7387b8a8bfd866d399abc2d9e434f7e6d321fa73cb1738ff9aa7ee22ac064c455d5d3951ba7469a30720c9474af5e96c70eaa5b5303a
7
+ data.tar.gz: b9d28d76c714947c1e6b133225e348838ad13f1c8b7dc82f0fee261272259cd0e83b911f2f2762c55a719f93e669275ad32d393f371c264a4e587e49b1c3a84b
data/CHANGELOG.md CHANGED
@@ -1,9 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.16.12 - 2025-10-29
4
+
5
+ - Fixed dump realloc bug that occurred when using the compat mode dump options.
6
+
7
+ ## 3.16.11 - 2025-05-29
8
+
9
+ - Fixed range encoding with the :circular option
10
+
3
11
  ## 3.16.10 - 2025-02-24
4
12
 
5
13
  - Changed oj_parser_type to be non-static.
6
14
 
15
+ - Changed ARM versions to used Neon instructions thanks to @samyron.
16
+
7
17
  ## 3.16.9 - 2024-12-28
8
18
 
9
19
  - Fixed `Oj::Parser` create_id size issue #931.
data/ext/oj/custom.c CHANGED
@@ -40,7 +40,7 @@ static void dump_obj_as_str(VALUE obj, int depth, Out out) {
40
40
  static void bigdecimal_dump(VALUE obj, int depth, Out out) {
41
41
  volatile VALUE rstr = oj_safe_string_convert(obj);
42
42
  const char *str = RSTRING_PTR(rstr);
43
- int len = (int)RSTRING_LEN(rstr);
43
+ size_t len = RSTRING_LEN(rstr);
44
44
 
45
45
  if (0 == strcasecmp("Infinity", str)) {
46
46
  str = oj_nan_str(obj, out->opts->dump_opts.nan_dump, out->opts->mode, true, &len);
@@ -123,7 +123,7 @@ static void date_dump(VALUE obj, int depth, Out out) {
123
123
  case RubyTime:
124
124
  case XmlTime:
125
125
  v = rb_funcall(obj, rb_intern("iso8601"), 0);
126
- oj_dump_cstr(RSTRING_PTR(v), (int)RSTRING_LEN(v), 0, 0, out);
126
+ oj_dump_cstr(RSTRING_PTR(v), RSTRING_LEN(v), 0, 0, out);
127
127
  break;
128
128
  case UnixZTime:
129
129
  v = rb_funcall(obj, rb_intern("to_time"), 0);
@@ -405,7 +405,7 @@ static void dump_odd(VALUE obj, Odd odd, VALUE clas, int depth, Out out) {
405
405
  rb_raise(rb_eEncodingError, "Invalid type for raw JSON.\n");
406
406
  } else {
407
407
  const char *s = RSTRING_PTR(v);
408
- int len = (int)RSTRING_LEN(v);
408
+ size_t len = RSTRING_LEN(v);
409
409
  const char *name = rb_id2name(*odd->attrs);
410
410
  size_t nlen = strlen(name);
411
411
 
@@ -478,7 +478,7 @@ static VALUE dump_common(VALUE obj, int depth, Out out) {
478
478
  } else if (Yes == out->opts->to_json && rb_respond_to(obj, oj_to_json_id)) {
479
479
  volatile VALUE rs;
480
480
  const char *s;
481
- int len;
481
+ size_t len;
482
482
 
483
483
  TRACE(out->opts->trace, "to_json", obj, depth + 1, TraceRubyIn);
484
484
  if (0 == rb_obj_method_arity(obj, oj_to_json_id)) {
@@ -488,7 +488,7 @@ static VALUE dump_common(VALUE obj, int depth, Out out) {
488
488
  }
489
489
  TRACE(out->opts->trace, "to_json", obj, depth + 1, TraceRubyOut);
490
490
  s = RSTRING_PTR(rs);
491
- len = (int)RSTRING_LEN(rs);
491
+ len = RSTRING_LEN(rs);
492
492
 
493
493
  assure_size(out, len + 1);
494
494
  APPEND_CHARS(out->cur, s, len);
@@ -509,7 +509,7 @@ static VALUE dump_common(VALUE obj, int depth, Out out) {
509
509
  if (aj == obj) {
510
510
  volatile VALUE rstr = oj_safe_string_convert(obj);
511
511
 
512
- oj_dump_cstr(RSTRING_PTR(rstr), (int)RSTRING_LEN(rstr), false, false, out);
512
+ oj_dump_cstr(RSTRING_PTR(rstr), RSTRING_LEN(rstr), false, false, out);
513
513
  } else {
514
514
  oj_dump_custom_val(aj, depth, out, true);
515
515
  }
@@ -676,7 +676,8 @@ static void dump_obj(VALUE obj, int depth, Out out, bool as_ok) {
676
676
 
677
677
  static void dump_array(VALUE a, int depth, Out out, bool as_ok) {
678
678
  size_t size;
679
- int i, cnt;
679
+ size_t i;
680
+ size_t cnt;
680
681
  int d2 = depth + 1;
681
682
  long id = oj_check_circular(a, out);
682
683
 
@@ -684,7 +685,7 @@ static void dump_array(VALUE a, int depth, Out out, bool as_ok) {
684
685
  oj_dump_nil(Qnil, depth, out, false);
685
686
  return;
686
687
  }
687
- cnt = (int)RARRAY_LEN(a);
688
+ cnt = RARRAY_LEN(a);
688
689
  *out->cur++ = '[';
689
690
  assure_size(out, 2);
690
691
  if (0 == cnt) {
@@ -795,7 +796,7 @@ static void dump_struct(VALUE obj, int depth, Out out, bool as_ok) {
795
796
  volatile VALUE s = rb_sym2str(RARRAY_AREF(ma, i));
796
797
 
797
798
  name = RSTRING_PTR(s);
798
- len = (int)RSTRING_LEN(s);
799
+ len = RSTRING_LEN(s);
799
800
  } else {
800
801
  len = snprintf(num_id, sizeof(num_id), "%d", i);
801
802
  name = num_id;