oj 3.10.6 → 3.12.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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -1
  3. data/ext/oj/buf.h +36 -68
  4. data/ext/oj/cache8.c +59 -62
  5. data/ext/oj/cache8.h +9 -36
  6. data/ext/oj/circarray.c +36 -42
  7. data/ext/oj/circarray.h +12 -13
  8. data/ext/oj/code.c +172 -179
  9. data/ext/oj/code.h +22 -24
  10. data/ext/oj/compat.c +176 -181
  11. data/ext/oj/custom.c +800 -864
  12. data/ext/oj/dump.c +774 -776
  13. data/ext/oj/dump.h +50 -55
  14. data/ext/oj/dump_compat.c +2 -4
  15. data/ext/oj/dump_leaf.c +118 -162
  16. data/ext/oj/dump_object.c +610 -632
  17. data/ext/oj/dump_strict.c +319 -331
  18. data/ext/oj/encode.h +4 -33
  19. data/ext/oj/err.c +40 -29
  20. data/ext/oj/err.h +25 -44
  21. data/ext/oj/extconf.rb +2 -1
  22. data/ext/oj/fast.c +1054 -1081
  23. data/ext/oj/hash.c +102 -97
  24. data/ext/oj/hash.h +10 -35
  25. data/ext/oj/hash_test.c +451 -472
  26. data/ext/oj/mimic_json.c +415 -402
  27. data/ext/oj/object.c +588 -532
  28. data/ext/oj/odd.c +124 -132
  29. data/ext/oj/odd.h +28 -29
  30. data/ext/oj/oj.c +1186 -906
  31. data/ext/oj/oj.h +289 -298
  32. data/ext/oj/parse.c +946 -870
  33. data/ext/oj/parse.h +81 -79
  34. data/ext/oj/rails.c +837 -842
  35. data/ext/oj/rails.h +8 -11
  36. data/ext/oj/reader.c +139 -147
  37. data/ext/oj/reader.h +68 -84
  38. data/ext/oj/resolve.c +44 -47
  39. data/ext/oj/resolve.h +4 -6
  40. data/ext/oj/rxclass.c +69 -73
  41. data/ext/oj/rxclass.h +13 -14
  42. data/ext/oj/saj.c +453 -484
  43. data/ext/oj/scp.c +88 -113
  44. data/ext/oj/sparse.c +783 -714
  45. data/ext/oj/stream_writer.c +123 -157
  46. data/ext/oj/strict.c +133 -106
  47. data/ext/oj/string_writer.c +199 -247
  48. data/ext/oj/trace.c +34 -41
  49. data/ext/oj/trace.h +15 -15
  50. data/ext/oj/util.c +104 -104
  51. data/ext/oj/util.h +4 -3
  52. data/ext/oj/val_stack.c +48 -76
  53. data/ext/oj/val_stack.h +80 -115
  54. data/ext/oj/wab.c +321 -325
  55. data/lib/oj.rb +0 -8
  56. data/lib/oj/bag.rb +1 -0
  57. data/lib/oj/easy_hash.rb +5 -4
  58. data/lib/oj/mimic.rb +47 -13
  59. data/lib/oj/version.rb +1 -1
  60. data/pages/Modes.md +1 -0
  61. data/pages/Options.md +23 -11
  62. data/test/activerecord/result_test.rb +7 -2
  63. data/test/foo.rb +8 -40
  64. data/test/helper.rb +10 -0
  65. data/test/json_gem/json_common_interface_test.rb +8 -3
  66. data/test/json_gem/json_generator_test.rb +15 -3
  67. data/test/json_gem/test_helper.rb +8 -0
  68. data/test/perf.rb +1 -1
  69. data/test/perf_scp.rb +11 -10
  70. data/test/perf_strict.rb +17 -23
  71. data/test/prec.rb +23 -0
  72. data/test/sample_json.rb +1 -1
  73. data/test/test_compat.rb +16 -3
  74. data/test/test_custom.rb +11 -0
  75. data/test/test_fast.rb +32 -2
  76. data/test/test_generate.rb +21 -0
  77. data/test/test_hash.rb +10 -0
  78. data/test/test_rails.rb +9 -0
  79. data/test/test_scp.rb +1 -1
  80. data/test/test_various.rb +4 -2
  81. metadata +89 -85
data/ext/oj/hash.c CHANGED
@@ -1,71 +1,46 @@
1
- /* hash.c
2
- * Copyright (c) 2011, Peter Ohler
3
- * All rights reserved.
4
- *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
7
- *
8
- * - Redistributions of source code must retain the above copyright notice, this
9
- * list of conditions and the following disclaimer.
10
- *
11
- * - Redistributions in binary form must reproduce the above copyright notice,
12
- * this list of conditions and the following disclaimer in the documentation
13
- * and/or other materials provided with the distribution.
14
- *
15
- * - Neither the name of Peter Ohler nor the names of its contributors may be
16
- * used to endorse or promote products derived from this software without
17
- * specific prior written permission.
18
- *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
- */
1
+ // Copyright (c) 2011 Peter Ohler. All rights reserved.
2
+ // Licensed under the MIT License. See LICENSE file in the project root for license details.
30
3
 
31
4
  #include "hash.h"
5
+
32
6
  #include <stdint.h>
33
7
 
34
- #define HASH_MASK 0x000003FF
35
- #define HASH_SLOT_CNT 1024
8
+ #define HASH_SLOT_CNT ((uint32_t)8192)
9
+ #define HASH_MASK (HASH_SLOT_CNT - 1)
36
10
 
37
11
  typedef struct _keyVal {
38
- struct _keyVal *next;
39
- const char *key;
40
- size_t len;
41
- VALUE val;
42
- } *KeyVal;
12
+ struct _keyVal *next;
13
+ const char * key;
14
+ size_t len;
15
+ VALUE val;
16
+ } * KeyVal;
43
17
 
44
18
  struct _hash {
45
- struct _keyVal slots[HASH_SLOT_CNT];
19
+ struct _keyVal slots[HASH_SLOT_CNT];
46
20
  };
47
21
 
48
- struct _hash class_hash;
49
- struct _hash intern_hash;
22
+ struct _hash class_hash;
23
+ struct _hash str_hash;
24
+ struct _hash sym_hash;
25
+ struct _hash intern_hash;
50
26
 
51
27
  // almost the Murmur hash algorithm
52
28
  #define M 0x5bd1e995
53
29
  #define C1 0xCC9E2D51
54
30
  #define C2 0x1B873593
55
- #define N 0xE6546B64
31
+ #define N 0xE6546B64
56
32
 
57
- static uint32_t
58
- hash_calc(const uint8_t *key, size_t len) {
59
- const uint8_t *end = key + len;
60
- const uint8_t *endless = key + (len / 4 * 4);
61
- uint32_t h = (uint32_t)len;
62
- uint32_t k;
33
+ static uint32_t hash_calc(const uint8_t *key, size_t len) {
34
+ const uint8_t *end = key + len;
35
+ const uint8_t *endless = key + (len / 4 * 4);
36
+ uint32_t h = (uint32_t)len;
37
+ uint32_t k;
63
38
 
64
39
  while (key < endless) {
65
- k = (uint32_t)*key++;
66
- k |= (uint32_t)*key++ << 8;
67
- k |= (uint32_t)*key++ << 16;
68
- k |= (uint32_t)*key++ << 24;
40
+ k = (uint32_t)*key++;
41
+ k |= (uint32_t)*key++ << 8;
42
+ k |= (uint32_t)*key++ << 16;
43
+ k |= (uint32_t)*key++ << 24;
69
44
 
70
45
  k *= M;
71
46
  k ^= k >> 24;
@@ -73,73 +48,95 @@ hash_calc(const uint8_t *key, size_t len) {
73
48
  h ^= k * M;
74
49
  }
75
50
  if (1 < end - key) {
76
- uint16_t k16 = (uint16_t)*key++;
51
+ uint16_t k16 = (uint16_t)*key++;
77
52
 
78
- k16 |= (uint16_t)*key++ << 8;
79
- h ^= k16 << 8;
53
+ k16 |= (uint16_t)*key++ << 8;
54
+ h ^= k16 << 8;
80
55
  }
81
56
  if (key < end) {
82
- h ^= *key;
57
+ h ^= *key;
83
58
  }
84
59
  h *= M;
85
60
  h ^= h >> 13;
86
61
  h *= M;
87
62
  h ^= h >> 15;
88
-
63
+
89
64
  return h;
90
65
  }
91
66
 
92
- void
93
- oj_hash_init() {
67
+ void oj_hash_init() {
94
68
  memset(class_hash.slots, 0, sizeof(class_hash.slots));
69
+ memset(str_hash.slots, 0, sizeof(str_hash.slots));
70
+ memset(sym_hash.slots, 0, sizeof(sym_hash.slots));
95
71
  memset(intern_hash.slots, 0, sizeof(intern_hash.slots));
96
72
  }
97
73
 
98
74
  // if slotp is 0 then just lookup
99
- static VALUE
100
- hash_get(Hash hash, const char *key, size_t len, VALUE **slotp, VALUE def_value) {
101
- uint32_t h = hash_calc((const uint8_t*)key, len) & HASH_MASK;
102
- KeyVal bucket = hash->slots + h;
75
+ static VALUE hash_get(Hash hash, const char *key, size_t len, VALUE **slotp, VALUE def_value) {
76
+ uint32_t h = hash_calc((const uint8_t *)key, len) & HASH_MASK;
77
+ KeyVal bucket = hash->slots + h;
103
78
 
104
79
  if (0 != bucket->key) {
105
- KeyVal b;
106
-
107
- for (b = bucket; 0 != b; b = b->next) {
108
- if (len == b->len && 0 == strncmp(b->key, key, len)) {
109
- *slotp = &b->val;
110
- return b->val;
111
- }
112
- bucket = b;
113
- }
80
+ KeyVal b;
81
+
82
+ for (b = bucket; 0 != b; b = b->next) {
83
+ if (len == b->len && 0 == strncmp(b->key, key, len)) {
84
+ *slotp = &b->val;
85
+ return b->val;
86
+ }
87
+ bucket = b;
88
+ }
114
89
  }
115
90
  if (0 != slotp) {
116
- if (0 != bucket->key) {
117
- KeyVal b = ALLOC(struct _keyVal);
118
-
119
- b->next = 0;
120
- bucket->next = b;
121
- bucket = b;
122
- }
123
- bucket->key = oj_strndup(key, len);
124
- bucket->len = len;
125
- bucket->val = def_value;
126
- *slotp = &bucket->val;
91
+ if (0 != bucket->key) {
92
+ KeyVal b = ALLOC(struct _keyVal);
93
+
94
+ b->next = 0;
95
+ bucket->next = b;
96
+ bucket = b;
97
+ }
98
+ bucket->key = oj_strndup(key, len);
99
+ bucket->len = len;
100
+ bucket->val = def_value;
101
+ *slotp = &bucket->val;
127
102
  }
128
103
  return def_value;
129
104
  }
130
105
 
131
- void
132
- oj_hash_print() {
133
- int i;
134
- KeyVal b;
106
+ void oj_hash_print() {
107
+ uint32_t i;
108
+ KeyVal b;
109
+
110
+ for (i = 0; i < HASH_SLOT_CNT; i++) {
111
+ printf("%4d:", i);
112
+ for (b = class_hash.slots + i; 0 != b && 0 != b->key; b = b->next) {
113
+ printf(" %s", b->key);
114
+ }
115
+ printf("\n");
116
+ }
117
+ }
118
+
119
+ void oj_hash_sizes() {
120
+ uint32_t i;
121
+ KeyVal b;
122
+ int max = 0;
123
+ int min = 1000000;
135
124
 
136
125
  for (i = 0; i < HASH_SLOT_CNT; i++) {
137
- printf("%4d:", i);
138
- for (b = class_hash.slots + i; 0 != b && 0 != b->key; b = b->next) {
139
- printf(" %s", b->key);
140
- }
141
- printf("\n");
126
+ int cnt = 0;
127
+
128
+ for (b = str_hash.slots + i; 0 != b && 0 != b->key; b = b->next) {
129
+ cnt++;
130
+ }
131
+ // printf(" %4d\n", cnt);
132
+ if (max < cnt) {
133
+ max = cnt;
134
+ }
135
+ if (cnt < min) {
136
+ min = cnt;
137
+ }
142
138
  }
139
+ printf("min: %d max: %d\n", min, max);
143
140
  }
144
141
 
145
142
  VALUE
@@ -147,15 +144,23 @@ oj_class_hash_get(const char *key, size_t len, VALUE **slotp) {
147
144
  return hash_get(&class_hash, key, len, slotp, Qnil);
148
145
  }
149
146
 
150
- ID
151
- oj_attr_hash_get(const char *key, size_t len, ID **slotp) {
152
- return (ID)hash_get(&intern_hash, key, len, (VALUE**)slotp, 0);
147
+ VALUE
148
+ oj_str_hash_get(const char *key, size_t len, VALUE **slotp) {
149
+ return hash_get(&str_hash, key, len, slotp, Qnil);
150
+ }
151
+
152
+ VALUE
153
+ oj_sym_hash_get(const char *key, size_t len, VALUE **slotp) {
154
+ return hash_get(&sym_hash, key, len, slotp, Qnil);
153
155
  }
154
156
 
155
- char*
156
- oj_strndup(const char *s, size_t len) {
157
- char *d = ALLOC_N(char, len + 1);
158
-
157
+ ID oj_attr_hash_get(const char *key, size_t len, ID **slotp) {
158
+ return (ID)hash_get(&intern_hash, key, len, (VALUE **)slotp, 0);
159
+ }
160
+
161
+ char *oj_strndup(const char *s, size_t len) {
162
+ char *d = ALLOC_N(char, len + 1);
163
+
159
164
  memcpy(d, s, len);
160
165
  d[len] = '\0';
161
166
 
data/ext/oj/hash.h CHANGED
@@ -1,46 +1,21 @@
1
- /* hash.h
2
- * Copyright (c) 2011, Peter Ohler
3
- * All rights reserved.
4
- *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
7
- *
8
- * - Redistributions of source code must retain the above copyright notice, this
9
- * list of conditions and the following disclaimer.
10
- *
11
- * - Redistributions in binary form must reproduce the above copyright notice,
12
- * this list of conditions and the following disclaimer in the documentation
13
- * and/or other materials provided with the distribution.
14
- *
15
- * - Neither the name of Peter Ohler nor the names of its contributors may be
16
- * used to endorse or promote products derived from this software without
17
- * specific prior written permission.
18
- *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
- */
1
+ // Copyright (c) 2011 Peter Ohler. All rights reserved.
2
+ // Licensed under the MIT License. See LICENSE file in the project root for license details.
30
3
 
31
4
  #ifndef OJ_HASH_H
32
5
  #define OJ_HASH_H
33
6
 
34
7
  #include "ruby.h"
35
8
 
36
- typedef struct _hash *Hash;
9
+ typedef struct _hash *Hash;
37
10
 
38
- extern void oj_hash_init();
11
+ extern void oj_hash_init();
39
12
 
40
- extern VALUE oj_class_hash_get(const char *key, size_t len, VALUE **slotp);
41
- extern ID oj_attr_hash_get(const char *key, size_t len, ID **slotp);
13
+ extern VALUE oj_class_hash_get(const char *key, size_t len, VALUE **slotp);
14
+ extern VALUE oj_str_hash_get(const char *key, size_t len, VALUE **slotp);
15
+ extern VALUE oj_sym_hash_get(const char *key, size_t len, VALUE **slotp);
16
+ extern ID oj_attr_hash_get(const char *key, size_t len, ID **slotp);
42
17
 
43
- extern void oj_hash_print();
44
- extern char* oj_strndup(const char *s, size_t len);
18
+ extern void oj_hash_print();
19
+ extern char *oj_strndup(const char *s, size_t len);
45
20
 
46
21
  #endif /* OJ_HASH_H */
data/ext/oj/hash_test.c CHANGED
@@ -1,509 +1,488 @@
1
- /* hash_test.c
2
- * Copyright (c) 2011, Peter Ohler
3
- * All rights reserved.
4
- *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
7
- *
8
- * - Redistributions of source code must retain the above copyright notice, this
9
- * list of conditions and the following disclaimer.
10
- *
11
- * - Redistributions in binary form must reproduce the above copyright notice,
12
- * this list of conditions and the following disclaimer in the documentation
13
- * and/or other materials provided with the distribution.
14
- *
15
- * - Neither the name of Peter Ohler nor the names of its contributors may be
16
- * used to endorse or promote products derived from this software without
17
- * specific prior written permission.
18
- *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
- */
1
+ // Copyright (c) 2011 Peter Ohler. All rights reserved.
2
+ // Licensed under the MIT License. See LICENSE file in the project root for license details.
30
3
 
31
4
  // if windows, comment out the whole file. It's only a performance test.
32
5
  #ifndef _WIN32
33
- #include <sys/time.h>
34
- #include <time.h>
35
6
  #include "hash.h"
7
+
36
8
  #include <stdint.h>
9
+ #include <sys/time.h>
10
+ #include <time.h>
37
11
 
38
12
  /* Define printf formats for standard types, like PRIu64 for uint64_t. */
39
13
  #define __STDC_FORMAT_MACROS
40
14
  #include <inttypes.h>
41
15
 
42
16
  typedef struct _strLen {
43
- const char *str;
44
- size_t len;
45
- } *StrLen;
17
+ const char *str;
18
+ size_t len;
19
+ } * StrLen;
46
20
 
47
- static struct _strLen data[] = {
48
- { "Gem::Version", 12 },
49
- { "TracePoint", 10 },
50
- { "Complex::compatible", 19 },
51
- { "Complex", 7 },
52
- { "Rational::compatible", 20 },
53
- { "Rational", 8 },
54
- { "FiberError", 10 },
55
- { "Fiber", 5 },
56
- { "ThreadError", 11 },
57
- { "Mutex", 5 },
58
- { "ThreadGroup", 11 },
59
- { "RubyVM::InstructionSequence", 27 },
60
- { "Thread::Backtrace::Location", 27 },
61
- { "Thread::Backtrace", 17 },
62
- { "Thread", 6 },
63
- { "RubyVM::Env", 11 },
64
- { "RubyVM", 6 },
65
- { "Enumerator::Yielder", 19 },
66
- { "Enumerator::Generator", 21 },
67
- { "StopIteration", 13 },
68
- { "Enumerator::Lazy", 16 },
69
- { "Enumerator", 10 },
70
- { "ObjectSpace::WeakMap", 20 },
71
- { "Math::DomainError", 17 },
72
- { "Binding", 7 },
73
- { "UnboundMethod", 13 },
74
- { "Method", 6 },
75
- { "SystemStackError", 16 },
76
- { "LocalJumpError", 14 },
77
- { "Proc", 4 },
78
- { "Struct::Tms", 11 },
79
- { "Process::Status", 15 },
80
- { "Random", 6 },
81
- { "Time", 4 },
82
- { "Dir", 3 },
83
- { "File::Stat", 10 },
84
- { "File", 4 },
85
- { "ARGF.class", 10 },
86
- { "IO", 2 },
87
- { "EOFError", 8 },
88
- { "IOError", 7 },
89
- { "Range", 5 },
90
- { "Encoding::Converter", 19 },
91
- { "Encoding::ConverterNotFoundError", 32 },
92
- { "Encoding::InvalidByteSequenceError", 34 },
93
- { "Encoding::UndefinedConversionError", 34 },
94
- { "MatchData", 9 },
95
- { "Regexp", 6 },
96
- { "RegexpError", 11 },
97
- { "Struct", 6 },
98
- { "Hash", 4 },
99
- { "Array", 5 },
100
- { "Errno::ERPCMISMATCH", 19 },
101
- { "Errno::EPROGUNAVAIL", 19 },
102
- { "Errno::EPROGMISMATCH", 20 },
103
- { "Errno::EPROCUNAVAIL", 19 },
104
- { "Errno::EPROCLIM", 15 },
105
- { "Errno::ENOTSUP", 14 },
106
- { "Errno::ENOATTR", 14 },
107
- { "Errno::ENEEDAUTH", 16 },
108
- { "Errno::EFTYPE", 13 },
109
- { "Errno::EBADRPC", 14 },
110
- { "Errno::EAUTH", 12 },
111
- { "Errno::EOWNERDEAD", 17 },
112
- { "Errno::ENOTRECOVERABLE", 22 },
113
- { "Errno::ECANCELED", 16 },
114
- { "Errno::EDQUOT", 13 },
115
- { "Errno::ESTALE", 13 },
116
- { "Errno::EINPROGRESS", 18 },
117
- { "Errno::EALREADY", 15 },
118
- { "Errno::EHOSTUNREACH", 19 },
119
- { "Errno::EHOSTDOWN", 16 },
120
- { "Errno::ECONNREFUSED", 19 },
121
- { "Errno::ETIMEDOUT", 16 },
122
- { "Errno::ETOOMANYREFS", 19 },
123
- { "Errno::ESHUTDOWN", 16 },
124
- { "Errno::ENOTCONN", 15 },
125
- { "Errno::EISCONN", 14 },
126
- { "Errno::ENOBUFS", 14 },
127
- { "Errno::ECONNRESET", 17 },
128
- { "Errno::ECONNABORTED", 19 },
129
- { "Errno::ENETRESET", 16 },
130
- { "Errno::ENETUNREACH", 18 },
131
- { "Errno::ENETDOWN", 15 },
132
- { "Errno::EADDRNOTAVAIL", 20 },
133
- { "Errno::EADDRINUSE", 17 },
134
- { "Errno::EAFNOSUPPORT", 19 },
135
- { "Errno::EPFNOSUPPORT", 19 },
136
- { "Errno::EOPNOTSUPP", 17 },
137
- { "Errno::ESOCKTNOSUPPORT", 22 },
138
- { "Errno::EPROTONOSUPPORT", 22 },
139
- { "Errno::ENOPROTOOPT", 18 },
140
- { "Errno::EPROTOTYPE", 17 },
141
- { "Errno::EMSGSIZE", 15 },
142
- { "Errno::EDESTADDRREQ", 19 },
143
- { "Errno::ENOTSOCK", 15 },
144
- { "Errno::EUSERS", 13 },
145
- { "Errno::EILSEQ", 13 },
146
- { "Errno::EOVERFLOW", 16 },
147
- { "Errno::EBADMSG", 14 },
148
- { "Errno::EMULTIHOP", 16 },
149
- { "Errno::EPROTO", 13 },
150
- { "Errno::ENOLINK", 14 },
151
- { "Errno::EREMOTE", 14 },
152
- { "Errno::ENOSR", 12 },
153
- { "Errno::ETIME", 12 },
154
- { "Errno::ENODATA", 14 },
155
- { "Errno::ENOSTR", 13 },
156
- { "Errno::EIDRM", 12 },
157
- { "Errno::ENOMSG", 13 },
158
- { "Errno::ELOOP", 12 },
159
- { "Errno::ENOTEMPTY", 16 },
160
- { "Errno::ENOSYS", 13 },
161
- { "Errno::ENOLCK", 13 },
162
- { "Errno::ENAMETOOLONG", 19 },
163
- { "Errno::EDEADLK", 14 },
164
- { "Errno::ERANGE", 13 },
165
- { "Errno::EDOM", 11 },
166
- { "Errno::EPIPE", 12 },
167
- { "Errno::EMLINK", 13 },
168
- { "Errno::EROFS", 12 },
169
- { "Errno::ESPIPE", 13 },
170
- { "Errno::ENOSPC", 13 },
171
- { "Errno::EFBIG", 12 },
172
- { "Errno::ETXTBSY", 14 },
173
- { "Errno::ENOTTY", 13 },
174
- { "Errno::EMFILE", 13 },
175
- { "Errno::ENFILE", 13 },
176
- { "Errno::EINVAL", 13 },
177
- { "Errno::EISDIR", 13 },
178
- { "Errno::ENOTDIR", 14 },
179
- { "Errno::ENODEV", 13 },
180
- { "Errno::EXDEV", 12 },
181
- { "Errno::EEXIST", 13 },
182
- { "Errno::EBUSY", 12 },
183
- { "Errno::ENOTBLK", 14 },
184
- { "Errno::EFAULT", 13 },
185
- { "Errno::EACCES", 13 },
186
- { "Errno::ENOMEM", 13 },
187
- { "Errno::EAGAIN", 13 },
188
- { "Errno::ECHILD", 13 },
189
- { "Errno::EBADF", 12 },
190
- { "Errno::ENOEXEC", 14 },
191
- { "Errno::E2BIG", 12 },
192
- { "Errno::ENXIO", 12 },
193
- { "Errno::EIO", 10 },
194
- { "Errno::EINTR", 12 },
195
- { "Errno::ESRCH", 12 },
196
- { "Errno::ENOENT", 13 },
197
- { "Errno::EPERM", 12 },
198
- { "Errno::NOERROR", 14 },
199
- { "Bignum", 6 },
200
- { "Float", 5 },
201
- { "Fixnum", 6 },
202
- { "Integer", 7 },
203
- { "Numeric", 7 },
204
- { "FloatDomainError", 16 },
205
- { "ZeroDivisionError", 17 },
206
- { "SystemCallError", 15 },
207
- { "Encoding::CompatibilityError", 28 },
208
- { "EncodingError", 13 },
209
- { "NoMemoryError", 13 },
210
- { "SecurityError", 13 },
211
- { "RuntimeError", 12 },
212
- { "NoMethodError", 13 },
213
- { "NameError::message", 18 },
214
- { "NameError", 9 },
215
- { "NotImplementedError", 19 },
216
- { "LoadError", 9 },
217
- { "SyntaxError", 11 },
218
- { "ScriptError", 11 },
219
- { "RangeError", 10 },
220
- { "KeyError", 8 },
221
- { "IndexError", 10 },
222
- { "ArgumentError", 13 },
223
- { "TypeError", 9 },
224
- { "StandardError", 13 },
225
- { "Interrupt", 9 },
226
- { "SignalException", 15 },
227
- { "SystemExit", 10 },
228
- { "Exception", 9 },
229
- { "Symbol", 6 },
230
- { "String", 6 },
231
- { "Encoding", 8 },
232
- { "FalseClass", 10 },
233
- { "TrueClass", 9 },
234
- { "Data", 4 },
235
- { "NilClass", 8 },
236
- { "Class", 5 },
237
- { "Module", 6 },
238
- { "Object", 6 },
239
- { "BasicObject", 11 },
240
- { "Gem::Requirement::BadRequirementError", 37 },
241
- { "Gem::Requirement", 16 },
242
- { "Gem::SourceFetchProblem", 23 },
243
- { "Gem::PlatformMismatch", 21 },
244
- { "Gem::ErrorReason", 16 },
245
- { "Gem::LoadError", 14 },
246
- { "Gem::RemoteSourceException", 26 },
247
- { "Gem::RemoteInstallationSkipped", 30 },
248
- { "Gem::RemoteInstallationCancelled", 32 },
249
- { "Gem::RemoteError", 16 },
250
- { "Gem::OperationNotSupportedError", 31 },
251
- { "Gem::InvalidSpecificationException", 34 },
252
- { "Gem::InstallError", 17 },
253
- { "Gem::Specification", 18 },
254
- { "Date", 4 },
255
- { "Gem::Platform", 13 },
256
- { "Gem::SpecificGemNotFoundException", 33 },
257
- { "Gem::GemNotFoundException", 25 },
258
- { "Gem::FormatException", 20 },
259
- { "Gem::FilePermissionError", 24 },
260
- { "Gem::EndOfYAMLException", 23 },
261
- { "Gem::DocumentError", 18 },
262
- { "Gem::GemNotInHomeException", 26 },
263
- { "Gem::DependencyRemovalException", 31 },
264
- { "Gem::DependencyError", 20 },
265
- { "Gem::CommandLineError", 21 },
266
- { "Gem::Exception", 14 },
267
- { "IRB::SLex", 9 },
268
- { "IRB::Notifier::NoMsgNotifier", 28 },
269
- { "IRB::Notifier::LeveledNotifier", 30 },
270
- { "IRB::Notifier::CompositeNotifier", 32 },
271
- { "IRB::Notifier::AbstractNotifier", 31 },
272
- { "IRB::Notifier::ErrUnrecognizedLevel", 35 },
273
- { "IRB::Notifier::ErrUndefinedNotifier", 35 },
274
- { "IRB::StdioOutputMethod", 22 },
275
- { "IRB::OutputMethod::NotImplementedError", 38 },
276
- { "IRB::OutputMethod", 17 },
277
- { "IRB::IllegalRCGenerator", 23 },
278
- { "IRB::UndefinedPromptMode", 24 },
279
- { "IRB::CantChangeBinding", 22 },
280
- { "IRB::CantShiftToMultiIrbMode", 28 },
281
- { "IRB::NoSuchJob", 14 },
282
- { "IRB::IrbSwitchedToCurrentThread", 31 },
283
- { "IRB::IrbAlreadyDead", 19 },
284
- { "IRB::IllegalParameter", 21 },
285
- { "IRB::CantReturnToNormalMode", 27 },
286
- { "IRB::NotImplementedError", 24 },
287
- { "IRB::UnrecognizedSwitch", 23 },
288
- { "IRB::Irb", 8 },
289
- { "IRB::Abort", 10 },
290
- { "IRB::Locale", 11 },
291
- { "IRB::SLex::ErrNodeNothing", 25 },
292
- { "IRB::SLex::ErrNodeAlreadyExists", 31 },
293
- { "RubyLex", 7 },
294
- { "IRB::SLex::Node", 15 },
295
- { "Gem::SystemExitException", 24 },
296
- { "Gem::VerificationError", 22 },
297
- { "RubyToken::TkError", 18 },
298
- { "RubyToken::TkUnknownChar", 24 },
299
- { "RubyToken::TkOPASGN", 19 },
300
- { "RubyToken::TkOp", 15 },
301
- { "RubyToken::TkVal", 16 },
302
- { "RubyToken::TkId", 15 },
303
- { "RubyToken::TkNode", 17 },
304
- { "RubyToken::Token", 16 },
305
- { "RubyToken::TkUNDEF", 18 },
306
- { "RubyToken::TkDEF", 16 },
307
- { "RubyToken::TkMODULE", 19 },
308
- { "RubyToken::TkCLASS", 18 },
309
- { "RubyToken::TkWHILE", 18 },
310
- { "RubyToken::TkWHEN", 17 },
311
- { "RubyToken::TkCASE", 17 },
312
- { "RubyToken::TkELSE", 17 },
313
- { "RubyToken::TkELSIF", 18 },
314
- { "RubyToken::TkTHEN", 17 },
315
- { "RubyToken::TkUNLESS", 19 },
316
- { "RubyToken::TkIF", 15 },
317
- { "RubyToken::TkEND", 16 },
318
- { "RubyToken::TkENSURE", 19 },
319
- { "RubyToken::TkRESCUE", 19 },
320
- { "RubyToken::TkBEGIN", 18 },
321
- { "RubyToken::TkDO", 15 },
322
- { "RubyToken::TkIN", 15 },
323
- { "RubyToken::TkRETRY", 18 },
324
- { "RubyToken::TkREDO", 17 },
325
- { "RubyToken::TkNEXT", 17 },
326
- { "RubyToken::TkBREAK", 18 },
327
- { "RubyToken::TkFOR", 16 },
328
- { "RubyToken::TkUNTIL", 18 },
329
- { "RubyToken::TkTRUE", 17 },
330
- { "RubyToken::TkNIL", 16 },
331
- { "RubyToken::TkSELF", 17 },
332
- { "RubyToken::TkSUPER", 18 },
333
- { "RubyToken::TkYIELD", 18 },
334
- { "RubyToken::TkRETURN", 19 },
335
- { "RubyToken::TkAND", 16 },
336
- { "RubyToken::TkFALSE", 18 },
337
- { "RubyToken::TkUNLESS_MOD", 23 },
338
- { "RubyToken::TkIF_MOD", 19 },
339
- { "RubyToken::TkNOT", 16 },
340
- { "RubyToken::TkOR", 15 },
341
- { "RubyToken::TkALIAS", 18 },
342
- { "RubyToken::TkUNTIL_MOD", 22 },
343
- { "RubyToken::TkWHILE_MOD", 22 },
344
- { "RubyToken::TkGVAR", 17 },
345
- { "RubyToken::TkFID", 16 },
346
- { "RubyToken::TkIDENTIFIER", 23 },
347
- { "RubyToken::Tk__FILE__", 21 },
348
- { "RubyToken::Tk__LINE__", 21 },
349
- { "RubyToken::TklEND", 17 },
350
- { "RubyToken::TklBEGIN", 19 },
351
- { "RubyToken::TkDEFINED", 20 },
352
- { "RubyToken::TkDREGEXP", 20 },
353
- { "RubyToken::TkDXSTRING", 21 },
354
- { "RubyToken::TkDSTRING", 20 },
355
- { "RubyToken::TkSYMBOL", 19 },
356
- { "RubyToken::TkREGEXP", 19 },
357
- { "RubyToken::TkXSTRING", 20 },
358
- { "RubyToken::TkSTRING", 19 },
359
- { "RubyToken::TkFLOAT", 18 },
360
- { "RubyToken::TkINTEGER", 20 },
361
- { "RubyToken::TkCONSTANT", 21 },
362
- { "RubyToken::TkIVAR", 17 },
363
- { "RubyToken::TkCVAR", 17 },
364
- { "RubyToken::TkNEQ", 16 },
365
- { "RubyToken::TkEQQ", 16 },
366
- { "RubyToken::TkEQ", 15 },
367
- { "RubyToken::TkCMP", 16 },
368
- { "RubyToken::TkPOW", 16 },
369
- { "RubyToken::TkUMINUS", 19 },
370
- { "RubyToken::TkUPLUS", 18 },
371
- { "Exception2MessageMapper::ErrNotRegisteredException", 50 },
372
- { "RubyToken::TkBACK_REF", 21 },
373
- { "RubyToken::TkNTH_REF", 20 },
374
- { "RubyToken::TkLSHFT", 18 },
375
- { "RubyToken::TkASET", 17 },
376
- { "RubyToken::TkAREF", 17 },
377
- { "RubyToken::TkDOT3", 17 },
378
- { "RubyToken::TkDOT2", 17 },
379
- { "RubyToken::TkNMATCH", 19 },
380
- { "RubyToken::TkMATCH", 18 },
381
- { "RubyToken::TkOROP", 17 },
382
- { "RubyToken::TkANDOP", 18 },
383
- { "RubyToken::TkLEQ", 16 },
384
- { "RubyToken::TkGEQ", 16 },
385
- { "RubyToken::TkAMPER", 18 },
386
- { "RubyToken::TkSTAR", 17 },
387
- { "RubyToken::TkfLBRACE", 20 },
388
- { "RubyToken::TkfLBRACK", 20 },
389
- { "RubyToken::TkfLPAREN", 20 },
390
- { "RubyToken::TkCOLON", 18 },
391
- { "RubyToken::TkQUESTION", 21 },
392
- { "RubyToken::TkASSOC", 18 },
393
- { "RubyToken::TkCOLON3", 19 },
394
- { "RubyToken::TkCOLON2", 19 },
395
- { "RubyToken::TkRSHFT", 18 },
396
- { "RubyToken::TkBITAND", 19 },
397
- { "RubyToken::TkBITXOR", 19 },
398
- { "RubyToken::TkBITOR", 18 },
399
- { "RubyToken::TkMOD", 16 },
400
- { "RubyToken::TkDIV", 16 },
401
- { "RubyToken::TkMULT", 17 },
402
- { "RubyToken::TkMINUS", 18 },
403
- { "RubyToken::TkPLUS", 17 },
404
- { "RubyToken::TkLT", 15 },
405
- { "RubyToken::TkGT", 15 },
406
- { "RubyToken::TkSYMBEG", 19 },
407
- { "IRB::DefaultEncodings", 21 },
408
- { "RubyToken::TkRPAREN", 19 },
409
- { "RubyToken::TkLBRACE", 19 },
410
- { "RubyToken::TkLBRACK", 19 },
411
- { "RubyToken::TkLPAREN", 19 },
412
- { "RubyToken::TkDOT", 16 },
413
- { "RubyToken::TkASSIGN", 19 },
414
- { "RubyToken::TkBACKQUOTE", 22 },
415
- { "RubyToken::TkNOTOP", 18 },
416
- { "RubyToken::TkBITNOT", 19 },
417
- { "RubyToken::TkDOLLAR", 19 },
418
- { "RubyToken::TkAT", 15 },
419
- { "RubyToken::TkBACKSLASH", 22 },
420
- { "RubyToken::TkEND_OF_SCRIPT", 26 },
421
- { "RubyToken::TkNL", 15 },
422
- { "RubyToken::TkSPACE", 18 },
423
- { "RubyToken::TkRD_COMMENT", 23 },
424
- { "RubyToken::TkCOMMENT", 20 },
425
- { "RubyToken::TkSEMICOLON", 22 },
426
- { "RubyToken::TkCOMMA", 18 },
427
- { "RubyToken::TkRBRACE", 19 },
428
- { "RubyToken::TkRBRACK", 19 },
429
- { "RubyLex::TerminateLineInput", 27 },
430
- { "RubyLex::SyntaxError", 20 },
431
- { "RubyLex::TkReading2TokenDuplicateError", 38 },
432
- { "RubyLex::TkSymbol2TokenNoKey", 28 },
433
- { "RubyLex::TkReading2TokenNoKey", 29 },
434
- { "RubyLex::AlreadyDefinedToken", 28 },
435
- { "IRB::FileInputMethod", 20 },
436
- { "IRB::StdioInputMethod", 21 },
437
- { "IRB::InputMethod", 16 },
438
- { "IRB::ReadlineInputMethod", 24 },
439
- { "IRB::Context", 12 },
440
- { "IRB::Inspector", 14 },
441
- { "IRB::WorkSpace", 14 },
442
- { 0, 0 }
443
- };
21
+ static struct _strLen data[] = {{"Gem::Version", 12},
22
+ {"TracePoint", 10},
23
+ {"Complex::compatible", 19},
24
+ {"Complex", 7},
25
+ {"Rational::compatible", 20},
26
+ {"Rational", 8},
27
+ {"FiberError", 10},
28
+ {"Fiber", 5},
29
+ {"ThreadError", 11},
30
+ {"Mutex", 5},
31
+ {"ThreadGroup", 11},
32
+ {"RubyVM::InstructionSequence", 27},
33
+ {"Thread::Backtrace::Location", 27},
34
+ {"Thread::Backtrace", 17},
35
+ {"Thread", 6},
36
+ {"RubyVM::Env", 11},
37
+ {"RubyVM", 6},
38
+ {"Enumerator::Yielder", 19},
39
+ {"Enumerator::Generator", 21},
40
+ {"StopIteration", 13},
41
+ {"Enumerator::Lazy", 16},
42
+ {"Enumerator", 10},
43
+ {"ObjectSpace::WeakMap", 20},
44
+ {"Math::DomainError", 17},
45
+ {"Binding", 7},
46
+ {"UnboundMethod", 13},
47
+ {"Method", 6},
48
+ {"SystemStackError", 16},
49
+ {"LocalJumpError", 14},
50
+ {"Proc", 4},
51
+ {"Struct::Tms", 11},
52
+ {"Process::Status", 15},
53
+ {"Random", 6},
54
+ {"Time", 4},
55
+ {"Dir", 3},
56
+ {"File::Stat", 10},
57
+ {"File", 4},
58
+ {"ARGF.class", 10},
59
+ {"IO", 2},
60
+ {"EOFError", 8},
61
+ {"IOError", 7},
62
+ {"Range", 5},
63
+ {"Encoding::Converter", 19},
64
+ {"Encoding::ConverterNotFoundError", 32},
65
+ {"Encoding::InvalidByteSequenceError", 34},
66
+ {"Encoding::UndefinedConversionError", 34},
67
+ {"MatchData", 9},
68
+ {"Regexp", 6},
69
+ {"RegexpError", 11},
70
+ {"Struct", 6},
71
+ {"Hash", 4},
72
+ {"Array", 5},
73
+ {"Errno::ERPCMISMATCH", 19},
74
+ {"Errno::EPROGUNAVAIL", 19},
75
+ {"Errno::EPROGMISMATCH", 20},
76
+ {"Errno::EPROCUNAVAIL", 19},
77
+ {"Errno::EPROCLIM", 15},
78
+ {"Errno::ENOTSUP", 14},
79
+ {"Errno::ENOATTR", 14},
80
+ {"Errno::ENEEDAUTH", 16},
81
+ {"Errno::EFTYPE", 13},
82
+ {"Errno::EBADRPC", 14},
83
+ {"Errno::EAUTH", 12},
84
+ {"Errno::EOWNERDEAD", 17},
85
+ {"Errno::ENOTRECOVERABLE", 22},
86
+ {"Errno::ECANCELED", 16},
87
+ {"Errno::EDQUOT", 13},
88
+ {"Errno::ESTALE", 13},
89
+ {"Errno::EINPROGRESS", 18},
90
+ {"Errno::EALREADY", 15},
91
+ {"Errno::EHOSTUNREACH", 19},
92
+ {"Errno::EHOSTDOWN", 16},
93
+ {"Errno::ECONNREFUSED", 19},
94
+ {"Errno::ETIMEDOUT", 16},
95
+ {"Errno::ETOOMANYREFS", 19},
96
+ {"Errno::ESHUTDOWN", 16},
97
+ {"Errno::ENOTCONN", 15},
98
+ {"Errno::EISCONN", 14},
99
+ {"Errno::ENOBUFS", 14},
100
+ {"Errno::ECONNRESET", 17},
101
+ {"Errno::ECONNABORTED", 19},
102
+ {"Errno::ENETRESET", 16},
103
+ {"Errno::ENETUNREACH", 18},
104
+ {"Errno::ENETDOWN", 15},
105
+ {"Errno::EADDRNOTAVAIL", 20},
106
+ {"Errno::EADDRINUSE", 17},
107
+ {"Errno::EAFNOSUPPORT", 19},
108
+ {"Errno::EPFNOSUPPORT", 19},
109
+ {"Errno::EOPNOTSUPP", 17},
110
+ {"Errno::ESOCKTNOSUPPORT", 22},
111
+ {"Errno::EPROTONOSUPPORT", 22},
112
+ {"Errno::ENOPROTOOPT", 18},
113
+ {"Errno::EPROTOTYPE", 17},
114
+ {"Errno::EMSGSIZE", 15},
115
+ {"Errno::EDESTADDRREQ", 19},
116
+ {"Errno::ENOTSOCK", 15},
117
+ {"Errno::EUSERS", 13},
118
+ {"Errno::EILSEQ", 13},
119
+ {"Errno::EOVERFLOW", 16},
120
+ {"Errno::EBADMSG", 14},
121
+ {"Errno::EMULTIHOP", 16},
122
+ {"Errno::EPROTO", 13},
123
+ {"Errno::ENOLINK", 14},
124
+ {"Errno::EREMOTE", 14},
125
+ {"Errno::ENOSR", 12},
126
+ {"Errno::ETIME", 12},
127
+ {"Errno::ENODATA", 14},
128
+ {"Errno::ENOSTR", 13},
129
+ {"Errno::EIDRM", 12},
130
+ {"Errno::ENOMSG", 13},
131
+ {"Errno::ELOOP", 12},
132
+ {"Errno::ENOTEMPTY", 16},
133
+ {"Errno::ENOSYS", 13},
134
+ {"Errno::ENOLCK", 13},
135
+ {"Errno::ENAMETOOLONG", 19},
136
+ {"Errno::EDEADLK", 14},
137
+ {"Errno::ERANGE", 13},
138
+ {"Errno::EDOM", 11},
139
+ {"Errno::EPIPE", 12},
140
+ {"Errno::EMLINK", 13},
141
+ {"Errno::EROFS", 12},
142
+ {"Errno::ESPIPE", 13},
143
+ {"Errno::ENOSPC", 13},
144
+ {"Errno::EFBIG", 12},
145
+ {"Errno::ETXTBSY", 14},
146
+ {"Errno::ENOTTY", 13},
147
+ {"Errno::EMFILE", 13},
148
+ {"Errno::ENFILE", 13},
149
+ {"Errno::EINVAL", 13},
150
+ {"Errno::EISDIR", 13},
151
+ {"Errno::ENOTDIR", 14},
152
+ {"Errno::ENODEV", 13},
153
+ {"Errno::EXDEV", 12},
154
+ {"Errno::EEXIST", 13},
155
+ {"Errno::EBUSY", 12},
156
+ {"Errno::ENOTBLK", 14},
157
+ {"Errno::EFAULT", 13},
158
+ {"Errno::EACCES", 13},
159
+ {"Errno::ENOMEM", 13},
160
+ {"Errno::EAGAIN", 13},
161
+ {"Errno::ECHILD", 13},
162
+ {"Errno::EBADF", 12},
163
+ {"Errno::ENOEXEC", 14},
164
+ {"Errno::E2BIG", 12},
165
+ {"Errno::ENXIO", 12},
166
+ {"Errno::EIO", 10},
167
+ {"Errno::EINTR", 12},
168
+ {"Errno::ESRCH", 12},
169
+ {"Errno::ENOENT", 13},
170
+ {"Errno::EPERM", 12},
171
+ {"Errno::NOERROR", 14},
172
+ {"Bignum", 6},
173
+ {"Float", 5},
174
+ {"Fixnum", 6},
175
+ {"Integer", 7},
176
+ {"Numeric", 7},
177
+ {"FloatDomainError", 16},
178
+ {"ZeroDivisionError", 17},
179
+ {"SystemCallError", 15},
180
+ {"Encoding::CompatibilityError", 28},
181
+ {"EncodingError", 13},
182
+ {"NoMemoryError", 13},
183
+ {"SecurityError", 13},
184
+ {"RuntimeError", 12},
185
+ {"NoMethodError", 13},
186
+ {"NameError::message", 18},
187
+ {"NameError", 9},
188
+ {"NotImplementedError", 19},
189
+ {"LoadError", 9},
190
+ {"SyntaxError", 11},
191
+ {"ScriptError", 11},
192
+ {"RangeError", 10},
193
+ {"KeyError", 8},
194
+ {"IndexError", 10},
195
+ {"ArgumentError", 13},
196
+ {"TypeError", 9},
197
+ {"StandardError", 13},
198
+ {"Interrupt", 9},
199
+ {"SignalException", 15},
200
+ {"SystemExit", 10},
201
+ {"Exception", 9},
202
+ {"Symbol", 6},
203
+ {"String", 6},
204
+ {"Encoding", 8},
205
+ {"FalseClass", 10},
206
+ {"TrueClass", 9},
207
+ {"Data", 4},
208
+ {"NilClass", 8},
209
+ {"Class", 5},
210
+ {"Module", 6},
211
+ {"Object", 6},
212
+ {"BasicObject", 11},
213
+ {"Gem::Requirement::BadRequirementError", 37},
214
+ {"Gem::Requirement", 16},
215
+ {"Gem::SourceFetchProblem", 23},
216
+ {"Gem::PlatformMismatch", 21},
217
+ {"Gem::ErrorReason", 16},
218
+ {"Gem::LoadError", 14},
219
+ {"Gem::RemoteSourceException", 26},
220
+ {"Gem::RemoteInstallationSkipped", 30},
221
+ {"Gem::RemoteInstallationCancelled", 32},
222
+ {"Gem::RemoteError", 16},
223
+ {"Gem::OperationNotSupportedError", 31},
224
+ {"Gem::InvalidSpecificationException", 34},
225
+ {"Gem::InstallError", 17},
226
+ {"Gem::Specification", 18},
227
+ {"Date", 4},
228
+ {"Gem::Platform", 13},
229
+ {"Gem::SpecificGemNotFoundException", 33},
230
+ {"Gem::GemNotFoundException", 25},
231
+ {"Gem::FormatException", 20},
232
+ {"Gem::FilePermissionError", 24},
233
+ {"Gem::EndOfYAMLException", 23},
234
+ {"Gem::DocumentError", 18},
235
+ {"Gem::GemNotInHomeException", 26},
236
+ {"Gem::DependencyRemovalException", 31},
237
+ {"Gem::DependencyError", 20},
238
+ {"Gem::CommandLineError", 21},
239
+ {"Gem::Exception", 14},
240
+ {"IRB::SLex", 9},
241
+ {"IRB::Notifier::NoMsgNotifier", 28},
242
+ {"IRB::Notifier::LeveledNotifier", 30},
243
+ {"IRB::Notifier::CompositeNotifier", 32},
244
+ {"IRB::Notifier::AbstractNotifier", 31},
245
+ {"IRB::Notifier::ErrUnrecognizedLevel", 35},
246
+ {"IRB::Notifier::ErrUndefinedNotifier", 35},
247
+ {"IRB::StdioOutputMethod", 22},
248
+ {"IRB::OutputMethod::NotImplementedError", 38},
249
+ {"IRB::OutputMethod", 17},
250
+ {"IRB::IllegalRCGenerator", 23},
251
+ {"IRB::UndefinedPromptMode", 24},
252
+ {"IRB::CantChangeBinding", 22},
253
+ {"IRB::CantShiftToMultiIrbMode", 28},
254
+ {"IRB::NoSuchJob", 14},
255
+ {"IRB::IrbSwitchedToCurrentThread", 31},
256
+ {"IRB::IrbAlreadyDead", 19},
257
+ {"IRB::IllegalParameter", 21},
258
+ {"IRB::CantReturnToNormalMode", 27},
259
+ {"IRB::NotImplementedError", 24},
260
+ {"IRB::UnrecognizedSwitch", 23},
261
+ {"IRB::Irb", 8},
262
+ {"IRB::Abort", 10},
263
+ {"IRB::Locale", 11},
264
+ {"IRB::SLex::ErrNodeNothing", 25},
265
+ {"IRB::SLex::ErrNodeAlreadyExists", 31},
266
+ {"RubyLex", 7},
267
+ {"IRB::SLex::Node", 15},
268
+ {"Gem::SystemExitException", 24},
269
+ {"Gem::VerificationError", 22},
270
+ {"RubyToken::TkError", 18},
271
+ {"RubyToken::TkUnknownChar", 24},
272
+ {"RubyToken::TkOPASGN", 19},
273
+ {"RubyToken::TkOp", 15},
274
+ {"RubyToken::TkVal", 16},
275
+ {"RubyToken::TkId", 15},
276
+ {"RubyToken::TkNode", 17},
277
+ {"RubyToken::Token", 16},
278
+ {"RubyToken::TkUNDEF", 18},
279
+ {"RubyToken::TkDEF", 16},
280
+ {"RubyToken::TkMODULE", 19},
281
+ {"RubyToken::TkCLASS", 18},
282
+ {"RubyToken::TkWHILE", 18},
283
+ {"RubyToken::TkWHEN", 17},
284
+ {"RubyToken::TkCASE", 17},
285
+ {"RubyToken::TkELSE", 17},
286
+ {"RubyToken::TkELSIF", 18},
287
+ {"RubyToken::TkTHEN", 17},
288
+ {"RubyToken::TkUNLESS", 19},
289
+ {"RubyToken::TkIF", 15},
290
+ {"RubyToken::TkEND", 16},
291
+ {"RubyToken::TkENSURE", 19},
292
+ {"RubyToken::TkRESCUE", 19},
293
+ {"RubyToken::TkBEGIN", 18},
294
+ {"RubyToken::TkDO", 15},
295
+ {"RubyToken::TkIN", 15},
296
+ {"RubyToken::TkRETRY", 18},
297
+ {"RubyToken::TkREDO", 17},
298
+ {"RubyToken::TkNEXT", 17},
299
+ {"RubyToken::TkBREAK", 18},
300
+ {"RubyToken::TkFOR", 16},
301
+ {"RubyToken::TkUNTIL", 18},
302
+ {"RubyToken::TkTRUE", 17},
303
+ {"RubyToken::TkNIL", 16},
304
+ {"RubyToken::TkSELF", 17},
305
+ {"RubyToken::TkSUPER", 18},
306
+ {"RubyToken::TkYIELD", 18},
307
+ {"RubyToken::TkRETURN", 19},
308
+ {"RubyToken::TkAND", 16},
309
+ {"RubyToken::TkFALSE", 18},
310
+ {"RubyToken::TkUNLESS_MOD", 23},
311
+ {"RubyToken::TkIF_MOD", 19},
312
+ {"RubyToken::TkNOT", 16},
313
+ {"RubyToken::TkOR", 15},
314
+ {"RubyToken::TkALIAS", 18},
315
+ {"RubyToken::TkUNTIL_MOD", 22},
316
+ {"RubyToken::TkWHILE_MOD", 22},
317
+ {"RubyToken::TkGVAR", 17},
318
+ {"RubyToken::TkFID", 16},
319
+ {"RubyToken::TkIDENTIFIER", 23},
320
+ {"RubyToken::Tk__FILE__", 21},
321
+ {"RubyToken::Tk__LINE__", 21},
322
+ {"RubyToken::TklEND", 17},
323
+ {"RubyToken::TklBEGIN", 19},
324
+ {"RubyToken::TkDEFINED", 20},
325
+ {"RubyToken::TkDREGEXP", 20},
326
+ {"RubyToken::TkDXSTRING", 21},
327
+ {"RubyToken::TkDSTRING", 20},
328
+ {"RubyToken::TkSYMBOL", 19},
329
+ {"RubyToken::TkREGEXP", 19},
330
+ {"RubyToken::TkXSTRING", 20},
331
+ {"RubyToken::TkSTRING", 19},
332
+ {"RubyToken::TkFLOAT", 18},
333
+ {"RubyToken::TkINTEGER", 20},
334
+ {"RubyToken::TkCONSTANT", 21},
335
+ {"RubyToken::TkIVAR", 17},
336
+ {"RubyToken::TkCVAR", 17},
337
+ {"RubyToken::TkNEQ", 16},
338
+ {"RubyToken::TkEQQ", 16},
339
+ {"RubyToken::TkEQ", 15},
340
+ {"RubyToken::TkCMP", 16},
341
+ {"RubyToken::TkPOW", 16},
342
+ {"RubyToken::TkUMINUS", 19},
343
+ {"RubyToken::TkUPLUS", 18},
344
+ {"Exception2MessageMapper::ErrNotRegisteredException", 50},
345
+ {"RubyToken::TkBACK_REF", 21},
346
+ {"RubyToken::TkNTH_REF", 20},
347
+ {"RubyToken::TkLSHFT", 18},
348
+ {"RubyToken::TkASET", 17},
349
+ {"RubyToken::TkAREF", 17},
350
+ {"RubyToken::TkDOT3", 17},
351
+ {"RubyToken::TkDOT2", 17},
352
+ {"RubyToken::TkNMATCH", 19},
353
+ {"RubyToken::TkMATCH", 18},
354
+ {"RubyToken::TkOROP", 17},
355
+ {"RubyToken::TkANDOP", 18},
356
+ {"RubyToken::TkLEQ", 16},
357
+ {"RubyToken::TkGEQ", 16},
358
+ {"RubyToken::TkAMPER", 18},
359
+ {"RubyToken::TkSTAR", 17},
360
+ {"RubyToken::TkfLBRACE", 20},
361
+ {"RubyToken::TkfLBRACK", 20},
362
+ {"RubyToken::TkfLPAREN", 20},
363
+ {"RubyToken::TkCOLON", 18},
364
+ {"RubyToken::TkQUESTION", 21},
365
+ {"RubyToken::TkASSOC", 18},
366
+ {"RubyToken::TkCOLON3", 19},
367
+ {"RubyToken::TkCOLON2", 19},
368
+ {"RubyToken::TkRSHFT", 18},
369
+ {"RubyToken::TkBITAND", 19},
370
+ {"RubyToken::TkBITXOR", 19},
371
+ {"RubyToken::TkBITOR", 18},
372
+ {"RubyToken::TkMOD", 16},
373
+ {"RubyToken::TkDIV", 16},
374
+ {"RubyToken::TkMULT", 17},
375
+ {"RubyToken::TkMINUS", 18},
376
+ {"RubyToken::TkPLUS", 17},
377
+ {"RubyToken::TkLT", 15},
378
+ {"RubyToken::TkGT", 15},
379
+ {"RubyToken::TkSYMBEG", 19},
380
+ {"IRB::DefaultEncodings", 21},
381
+ {"RubyToken::TkRPAREN", 19},
382
+ {"RubyToken::TkLBRACE", 19},
383
+ {"RubyToken::TkLBRACK", 19},
384
+ {"RubyToken::TkLPAREN", 19},
385
+ {"RubyToken::TkDOT", 16},
386
+ {"RubyToken::TkASSIGN", 19},
387
+ {"RubyToken::TkBACKQUOTE", 22},
388
+ {"RubyToken::TkNOTOP", 18},
389
+ {"RubyToken::TkBITNOT", 19},
390
+ {"RubyToken::TkDOLLAR", 19},
391
+ {"RubyToken::TkAT", 15},
392
+ {"RubyToken::TkBACKSLASH", 22},
393
+ {"RubyToken::TkEND_OF_SCRIPT", 26},
394
+ {"RubyToken::TkNL", 15},
395
+ {"RubyToken::TkSPACE", 18},
396
+ {"RubyToken::TkRD_COMMENT", 23},
397
+ {"RubyToken::TkCOMMENT", 20},
398
+ {"RubyToken::TkSEMICOLON", 22},
399
+ {"RubyToken::TkCOMMA", 18},
400
+ {"RubyToken::TkRBRACE", 19},
401
+ {"RubyToken::TkRBRACK", 19},
402
+ {"RubyLex::TerminateLineInput", 27},
403
+ {"RubyLex::SyntaxError", 20},
404
+ {"RubyLex::TkReading2TokenDuplicateError", 38},
405
+ {"RubyLex::TkSymbol2TokenNoKey", 28},
406
+ {"RubyLex::TkReading2TokenNoKey", 29},
407
+ {"RubyLex::AlreadyDefinedToken", 28},
408
+ {"IRB::FileInputMethod", 20},
409
+ {"IRB::StdioInputMethod", 21},
410
+ {"IRB::InputMethod", 16},
411
+ {"IRB::ReadlineInputMethod", 24},
412
+ {"IRB::Context", 12},
413
+ {"IRB::Inspector", 14},
414
+ {"IRB::WorkSpace", 14},
415
+ {0, 0}};
444
416
 
445
- static uint64_t
446
- micro_time() {
447
- struct timeval tv;
417
+ static uint64_t micro_time() {
418
+ struct timeval tv;
448
419
 
449
420
  gettimeofday(&tv, NULL);
450
421
 
451
422
  return (uint64_t)tv.tv_sec * 1000000ULL + (uint64_t)tv.tv_usec;
452
423
  }
453
424
 
454
- static void
455
- perf() {
456
- StrLen d;
457
- VALUE v;
458
- VALUE *slot = 0;
459
- uint64_t dt, start;
460
- int i, iter = 1000000;
461
- int dataCnt = sizeof(data) / sizeof(*data);
425
+ static void perf() {
426
+ StrLen d;
427
+ VALUE v;
428
+ VALUE * slot = 0;
429
+ uint64_t dt, start;
430
+ int i, iter = 1000000;
431
+ int dataCnt = sizeof(data) / sizeof(*data);
462
432
 
463
433
  oj_hash_init();
464
434
  start = micro_time();
465
435
  for (i = iter; 0 < i; i--) {
466
- for (d = data; 0 != d->str; d++) {
467
- v = oj_class_hash_get(d->str, d->len, &slot);
468
- if (Qundef == v) {
469
- if (0 != slot) {
470
- v = ID2SYM(rb_intern(d->str));
471
- *slot = v;
472
- }
473
- }
474
- }
436
+ for (d = data; 0 != d->str; d++) {
437
+ v = oj_class_hash_get(d->str, d->len, &slot);
438
+ if (Qundef == v) {
439
+ if (0 != slot) {
440
+ v = ID2SYM(rb_intern(d->str));
441
+ *slot = v;
442
+ }
443
+ }
444
+ }
475
445
  }
476
446
  dt = micro_time() - start;
477
447
  #if IS_WINDOWS
478
- printf("%d iterations took %ld msecs, %ld gets/msec\n", iter, (long)(dt / 1000), (long)(iter * dataCnt / (dt / 1000)));
448
+ printf("%d iterations took %ld msecs, %ld gets/msec\n",
449
+ iter,
450
+ (long)(dt / 1000),
451
+ (long)(iter * dataCnt / (dt / 1000)));
479
452
  #else
480
- printf("%d iterations took %"PRIu64" msecs, %ld gets/msec\n", iter, dt / 1000, (long)(iter * dataCnt / (dt / 1000)));
453
+ printf("%d iterations took %" PRIu64 " msecs, %ld gets/msec\n",
454
+ iter,
455
+ dt / 1000,
456
+ (long)(iter * dataCnt / (dt / 1000)));
481
457
  #endif
482
458
  }
483
459
 
484
- void
485
- oj_hash_test() {
486
- StrLen d;
487
- VALUE v;
488
- VALUE *slot = 0;;
460
+ void oj_hash_test() {
461
+ StrLen d;
462
+ VALUE v;
463
+ VALUE *slot = 0;
464
+ ;
489
465
 
490
466
  oj_hash_init();
491
467
  for (d = data; 0 != d->str; d++) {
492
- char *s = oj_strndup(d->str, d->len);
493
- v = oj_class_hash_get(d->str, d->len, &slot);
494
- if (Qnil == v) {
495
- if (0 == slot) {
496
- printf("*** failed to get a slot for %s\n", s);
497
- } else {
498
- v = ID2SYM(rb_intern(d->str));
499
- *slot = v;
500
- }
501
- } else {
502
- VALUE rs = rb_funcall2(v, rb_intern("to_s"), 0, 0);
468
+ char *s = oj_strndup(d->str, d->len);
469
+ v = oj_class_hash_get(d->str, d->len, &slot);
470
+ if (Qnil == v) {
471
+ if (0 == slot) {
472
+ printf("*** failed to get a slot for %s\n", s);
473
+ } else {
474
+ v = ID2SYM(rb_intern(d->str));
475
+ *slot = v;
476
+ }
477
+ } else {
478
+ VALUE rs = rb_funcall2(v, rb_intern("to_s"), 0, 0);
503
479
 
504
- printf("*** get on '%s' returned '%s' (%s)\n", s, StringValuePtr(rs), rb_class2name(rb_obj_class(v)));
505
- }
506
- /*oj_hash_print(c);*/
480
+ printf("*** get on '%s' returned '%s' (%s)\n",
481
+ s,
482
+ StringValuePtr(rs),
483
+ rb_class2name(rb_obj_class(v)));
484
+ }
485
+ /*oj_hash_print(c);*/
507
486
  }
508
487
  printf("*** ---------- hash table ------------\n");
509
488
  oj_hash_print();