debase-ruby_core_source 0.10.10 → 0.10.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +6 -3
- data/debase-ruby_core_source.gemspec +4 -4
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/addr2line.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/builtin.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/list/list.h +788 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/str/str.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/constant.h +55 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/debug_counter.h +423 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/dln.h +36 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/encindex.h +70 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/eval_intern.h +312 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/gc.h +140 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/hrtime.h +168 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/id.h +290 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/id_table.h +36 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/insns.inc +249 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/insns_info.inc +8979 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal.h +107 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/array.h +114 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/bignum.h +246 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/bits.h +566 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/class.h +168 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compar.h +50 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compile.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compilers.h +108 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/complex.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/cont.h +25 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/dir.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enc.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/encoding.h +28 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enum.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enumerator.h +22 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/error.h +131 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/eval.h +33 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/file.h +39 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/fixnum.h +185 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/gc.h +154 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/hash.h +240 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/imemo.h +243 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/inits.h +51 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/io.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/load.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/loadpath.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/math.h +24 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/missing.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/mjit.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/numeric.h +252 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/object.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/parse.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/proc.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/process.h +136 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/random.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/range.h +37 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/rational.h +69 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/re.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/sanitizers.h +191 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/scheduler.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/serial.h +24 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/signal.h +22 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/static_assert.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/string.h +135 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/struct.h +154 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/symbol.h +41 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/thread.h +60 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/time.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/transcode.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/util.h +31 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/variable.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/vm.h +135 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/warnings.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/iseq.h +304 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/known_errors.inc +791 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/method.h +245 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/mjit.h +197 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/mjit_compile.inc +8082 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/node.h +484 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/node_name.inc +210 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/opt_sc.inc +109 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/optinsn.inc +128 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/optunifs.inc +43 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/parse.h +211 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/probes_helper.h +44 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ractor.h +271 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ractor_pub.h +50 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regenc.h +254 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regint.h +938 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regparse.h +370 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/revision.h +2 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ruby_assert.h +15 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ruby_atomic.h +236 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/symbol.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/thread_pthread.h +106 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/thread_win32.h +66 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/timev.h +57 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/transcode_data.h +138 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/transient_heap.h +61 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/variable.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/version.h +89 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm.inc +5360 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_call_iseq_optimized.inc +244 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_callinfo.h +457 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_core.h +1952 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_debug.h +116 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_exec.h +196 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_insnhelper.h +260 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_opts.h +73 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_sync.h +97 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vmtc.inc +243 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +123 -13
@@ -0,0 +1,154 @@
|
|
1
|
+
#ifndef INTERNAL_GC_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define INTERNAL_GC_H
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
9
|
+
* file COPYING are met. Consult the file for details.
|
10
|
+
* @brief Internal header for GC.
|
11
|
+
*/
|
12
|
+
#include "ruby/internal/config.h"
|
13
|
+
|
14
|
+
#include <stddef.h> /* for size_t */
|
15
|
+
|
16
|
+
#include "internal/compilers.h" /* for __has_attribute */
|
17
|
+
#include "ruby/ruby.h" /* for rb_event_flag_t */
|
18
|
+
|
19
|
+
struct rb_execution_context_struct; /* in vm_core.h */
|
20
|
+
struct rb_objspace; /* in vm_core.h */
|
21
|
+
|
22
|
+
#ifdef NEWOBJ_OF
|
23
|
+
# undef NEWOBJ_OF
|
24
|
+
# undef RB_NEWOBJ_OF
|
25
|
+
# undef RB_OBJ_WRITE
|
26
|
+
#endif
|
27
|
+
|
28
|
+
/* optimized version of NEWOBJ() */
|
29
|
+
#define RB_NEWOBJ_OF(var, T, c, f) \
|
30
|
+
T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \
|
31
|
+
rb_wb_protected_newobj_of((c), (f) & ~FL_WB_PROTECTED) : \
|
32
|
+
rb_wb_unprotected_newobj_of((c), (f)))
|
33
|
+
#define NEWOBJ_OF(var, T, c, f) RB_NEWOBJ_OF((var), T, (c), (f))
|
34
|
+
#define RB_OBJ_GC_FLAGS_MAX 6 /* used in ext/objspace */
|
35
|
+
|
36
|
+
#ifndef USE_UNALIGNED_MEMBER_ACCESS
|
37
|
+
# define UNALIGNED_MEMBER_ACCESS(expr) (expr)
|
38
|
+
#elif ! USE_UNALIGNED_MEMBER_ACCESS
|
39
|
+
# define UNALIGNED_MEMBER_ACCESS(expr) (expr)
|
40
|
+
#elif ! (__has_warning("-Waddress-of-packed-member") || GCC_VERSION_SINCE(9, 0, 0))
|
41
|
+
# define UNALIGNED_MEMBER_ACCESS(expr) (expr)
|
42
|
+
#else
|
43
|
+
# include "internal/warnings.h"
|
44
|
+
# define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \
|
45
|
+
COMPILER_WARNING_PUSH; \
|
46
|
+
COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \
|
47
|
+
__typeof__(expr) unaligned_member_access_result = (expr); \
|
48
|
+
COMPILER_WARNING_POP; \
|
49
|
+
unaligned_member_access_result; \
|
50
|
+
})
|
51
|
+
#endif
|
52
|
+
|
53
|
+
#define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
|
54
|
+
#define RB_OBJ_WRITE(a, slot, b) \
|
55
|
+
UNALIGNED_MEMBER_ACCESS(\
|
56
|
+
rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__))
|
57
|
+
|
58
|
+
/* gc.c */
|
59
|
+
extern VALUE *ruby_initial_gc_stress_ptr;
|
60
|
+
extern int ruby_disable_gc;
|
61
|
+
RUBY_ATTR_MALLOC void *ruby_mimmalloc(size_t size);
|
62
|
+
void ruby_mimfree(void *ptr);
|
63
|
+
void rb_objspace_set_event_hook(const rb_event_flag_t event);
|
64
|
+
VALUE rb_objspace_gc_enable(struct rb_objspace *);
|
65
|
+
VALUE rb_objspace_gc_disable(struct rb_objspace *);
|
66
|
+
void ruby_gc_set_params(void);
|
67
|
+
void rb_copy_wb_protected_attribute(VALUE dest, VALUE obj);
|
68
|
+
#if __has_attribute(alloc_align)
|
69
|
+
__attribute__((__alloc_align__(1)))
|
70
|
+
#endif
|
71
|
+
RUBY_ATTR_MALLOC void *rb_aligned_malloc(size_t, size_t) RUBY_ATTR_ALLOC_SIZE((2));
|
72
|
+
size_t rb_size_mul_or_raise(size_t, size_t, VALUE); /* used in compile.c */
|
73
|
+
size_t rb_size_mul_add_or_raise(size_t, size_t, size_t, VALUE); /* used in iseq.h */
|
74
|
+
RUBY_ATTR_MALLOC void *rb_xmalloc_mul_add(size_t, size_t, size_t);
|
75
|
+
void *rb_xrealloc_mul_add(const void *, size_t, size_t, size_t);
|
76
|
+
RUBY_ATTR_MALLOC void *rb_xmalloc_mul_add_mul(size_t, size_t, size_t, size_t);
|
77
|
+
RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add_mul(size_t, size_t, size_t, size_t);
|
78
|
+
static inline void *ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
|
79
|
+
static inline void *ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
|
80
|
+
static inline void ruby_sized_xfree_inlined(void *ptr, size_t size);
|
81
|
+
VALUE rb_class_allocate_instance(VALUE klass);
|
82
|
+
|
83
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
84
|
+
/* gc.c (export) */
|
85
|
+
const char *rb_objspace_data_type_name(VALUE obj);
|
86
|
+
VALUE rb_wb_protected_newobj_of(VALUE, VALUE);
|
87
|
+
VALUE rb_wb_unprotected_newobj_of(VALUE, VALUE);
|
88
|
+
size_t rb_obj_memsize_of(VALUE);
|
89
|
+
void rb_gc_verify_internal_consistency(void);
|
90
|
+
size_t rb_obj_gc_flags(VALUE, ID[], size_t);
|
91
|
+
void rb_gc_mark_values(long n, const VALUE *values);
|
92
|
+
void rb_gc_mark_vm_stack_values(long n, const VALUE *values);
|
93
|
+
void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
|
94
|
+
void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
|
95
|
+
void ruby_sized_xfree(void *x, size_t size);
|
96
|
+
RUBY_SYMBOL_EXPORT_END
|
97
|
+
|
98
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
99
|
+
int rb_ec_stack_check(struct rb_execution_context_struct *ec);
|
100
|
+
void rb_gc_writebarrier_remember(VALUE obj);
|
101
|
+
const char *rb_obj_info(VALUE obj);
|
102
|
+
MJIT_SYMBOL_EXPORT_END
|
103
|
+
|
104
|
+
#if defined(HAVE_MALLOC_USABLE_SIZE) || defined(HAVE_MALLOC_SIZE) || defined(_WIN32)
|
105
|
+
|
106
|
+
static inline void *
|
107
|
+
ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size)
|
108
|
+
{
|
109
|
+
return ruby_xrealloc(ptr, new_size);
|
110
|
+
}
|
111
|
+
|
112
|
+
static inline void *
|
113
|
+
ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count)
|
114
|
+
{
|
115
|
+
return ruby_xrealloc2(ptr, new_count, elemsiz);
|
116
|
+
}
|
117
|
+
|
118
|
+
static inline void
|
119
|
+
ruby_sized_xfree_inlined(void *ptr, size_t size)
|
120
|
+
{
|
121
|
+
ruby_xfree(ptr);
|
122
|
+
}
|
123
|
+
|
124
|
+
# define SIZED_REALLOC_N(x, y, z, w) REALLOC_N(x, y, z)
|
125
|
+
|
126
|
+
#else
|
127
|
+
|
128
|
+
static inline void *
|
129
|
+
ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size)
|
130
|
+
{
|
131
|
+
return ruby_sized_xrealloc(ptr, new_size, old_size);
|
132
|
+
}
|
133
|
+
|
134
|
+
static inline void *
|
135
|
+
ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count)
|
136
|
+
{
|
137
|
+
return ruby_sized_xrealloc2(ptr, new_count, elemsiz, old_count);
|
138
|
+
}
|
139
|
+
|
140
|
+
static inline void
|
141
|
+
ruby_sized_xfree_inlined(void *ptr, size_t size)
|
142
|
+
{
|
143
|
+
ruby_sized_xfree(ptr, size);
|
144
|
+
}
|
145
|
+
|
146
|
+
# define SIZED_REALLOC_N(v, T, m, n) \
|
147
|
+
((v) = (T *)ruby_sized_xrealloc2((void *)(v), (m), sizeof(T), (n)))
|
148
|
+
|
149
|
+
#endif /* HAVE_MALLOC_USABLE_SIZE */
|
150
|
+
|
151
|
+
#define ruby_sized_xrealloc ruby_sized_xrealloc_inlined
|
152
|
+
#define ruby_sized_xrealloc2 ruby_sized_xrealloc2_inlined
|
153
|
+
#define ruby_sized_xfree ruby_sized_xfree_inlined
|
154
|
+
#endif /* INTERNAL_GC_H */
|
@@ -0,0 +1,240 @@
|
|
1
|
+
#ifndef INTERNAL_HASH_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define INTERNAL_HASH_H
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
9
|
+
* file COPYING are met. Consult the file for details.
|
10
|
+
* @brief Internal header for Hash.
|
11
|
+
*/
|
12
|
+
#include "ruby/internal/config.h"
|
13
|
+
#include <stddef.h> /* for size_t */
|
14
|
+
#include "ruby/internal/stdbool.h" /* for bool */
|
15
|
+
#include "ruby/ruby.h" /* for struct RBasic */
|
16
|
+
#include "ruby/st.h" /* for struct st_table */
|
17
|
+
|
18
|
+
#define RHASH_AR_TABLE_MAX_SIZE SIZEOF_VALUE
|
19
|
+
|
20
|
+
struct ar_table_struct;
|
21
|
+
typedef unsigned char ar_hint_t;
|
22
|
+
|
23
|
+
enum ruby_rhash_flags {
|
24
|
+
RHASH_PASS_AS_KEYWORDS = FL_USER1, /* FL 1 */
|
25
|
+
RHASH_PROC_DEFAULT = FL_USER2, /* FL 2 */
|
26
|
+
RHASH_ST_TABLE_FLAG = FL_USER3, /* FL 3 */
|
27
|
+
RHASH_AR_TABLE_SIZE_MASK = (FL_USER4|FL_USER5|FL_USER6|FL_USER7), /* FL 4..7 */
|
28
|
+
RHASH_AR_TABLE_SIZE_SHIFT = (FL_USHIFT+4),
|
29
|
+
RHASH_AR_TABLE_BOUND_MASK = (FL_USER8|FL_USER9|FL_USER10|FL_USER11), /* FL 8..11 */
|
30
|
+
RHASH_AR_TABLE_BOUND_SHIFT = (FL_USHIFT+8),
|
31
|
+
|
32
|
+
#if USE_TRANSIENT_HEAP
|
33
|
+
RHASH_TRANSIENT_FLAG = FL_USER12, /* FL 12 */
|
34
|
+
#endif
|
35
|
+
|
36
|
+
// we can not put it in "enum" because it can exceed "int" range.
|
37
|
+
#define RHASH_LEV_MASK (FL_USER13 | FL_USER14 | FL_USER15 | /* FL 13..19 */ \
|
38
|
+
FL_USER16 | FL_USER17 | FL_USER18 | FL_USER19)
|
39
|
+
|
40
|
+
RHASH_LEV_SHIFT = (FL_USHIFT + 13),
|
41
|
+
RHASH_LEV_MAX = 127, /* 7 bits */
|
42
|
+
};
|
43
|
+
|
44
|
+
struct RHash {
|
45
|
+
struct RBasic basic;
|
46
|
+
union {
|
47
|
+
st_table *st;
|
48
|
+
struct ar_table_struct *ar; /* possibly 0 */
|
49
|
+
} as;
|
50
|
+
const VALUE ifnone;
|
51
|
+
union {
|
52
|
+
ar_hint_t ary[RHASH_AR_TABLE_MAX_SIZE];
|
53
|
+
VALUE word;
|
54
|
+
} ar_hint;
|
55
|
+
};
|
56
|
+
|
57
|
+
#define RHASH(obj) ((struct RHash *)(obj))
|
58
|
+
|
59
|
+
#ifdef RHASH_IFNONE
|
60
|
+
# undef RHASH_IFNONE
|
61
|
+
#endif
|
62
|
+
|
63
|
+
#ifdef RHASH_SIZE
|
64
|
+
# undef RHASH_SIZE
|
65
|
+
#endif
|
66
|
+
|
67
|
+
#ifdef RHASH_EMPTY_P
|
68
|
+
# undef RHASH_EMPTY_P
|
69
|
+
#endif
|
70
|
+
|
71
|
+
/* hash.c */
|
72
|
+
void rb_hash_st_table_set(VALUE hash, st_table *st);
|
73
|
+
VALUE rb_hash_default_value(VALUE hash, VALUE key);
|
74
|
+
VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc);
|
75
|
+
long rb_dbl_long_hash(double d);
|
76
|
+
st_table *rb_init_identtable(void);
|
77
|
+
VALUE rb_to_hash_type(VALUE obj);
|
78
|
+
VALUE rb_hash_key_str(VALUE);
|
79
|
+
VALUE rb_hash_values(VALUE hash);
|
80
|
+
VALUE rb_hash_rehash(VALUE hash);
|
81
|
+
int rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val);
|
82
|
+
VALUE rb_hash_set_pair(VALUE hash, VALUE pair);
|
83
|
+
int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval);
|
84
|
+
int rb_hash_stlike_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg);
|
85
|
+
int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func *func, st_data_t arg);
|
86
|
+
static inline unsigned RHASH_AR_TABLE_SIZE_RAW(VALUE h);
|
87
|
+
static inline VALUE RHASH_IFNONE(VALUE h);
|
88
|
+
static inline size_t RHASH_SIZE(VALUE h);
|
89
|
+
static inline bool RHASH_EMPTY_P(VALUE h);
|
90
|
+
static inline bool RHASH_AR_TABLE_P(VALUE h);
|
91
|
+
static inline bool RHASH_ST_TABLE_P(VALUE h);
|
92
|
+
static inline struct ar_table_struct *RHASH_AR_TABLE(VALUE h);
|
93
|
+
static inline st_table *RHASH_ST_TABLE(VALUE h);
|
94
|
+
static inline size_t RHASH_ST_SIZE(VALUE h);
|
95
|
+
static inline void RHASH_ST_CLEAR(VALUE h);
|
96
|
+
static inline bool RHASH_TRANSIENT_P(VALUE h);
|
97
|
+
static inline void RHASH_SET_TRANSIENT_FLAG(VALUE h);
|
98
|
+
static inline void RHASH_UNSET_TRANSIENT_FLAG(VALUE h);
|
99
|
+
|
100
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
101
|
+
/* hash.c (export) */
|
102
|
+
VALUE rb_hash_delete_entry(VALUE hash, VALUE key);
|
103
|
+
VALUE rb_ident_hash_new(void);
|
104
|
+
int rb_hash_stlike_foreach(VALUE hash, st_foreach_callback_func *func, st_data_t arg);
|
105
|
+
RUBY_SYMBOL_EXPORT_END
|
106
|
+
|
107
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
108
|
+
VALUE rb_hash_new_with_size(st_index_t size);
|
109
|
+
VALUE rb_hash_resurrect(VALUE hash);
|
110
|
+
int rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval);
|
111
|
+
VALUE rb_hash_keys(VALUE hash);
|
112
|
+
VALUE rb_hash_has_key(VALUE hash, VALUE key);
|
113
|
+
VALUE rb_hash_compare_by_id_p(VALUE hash);
|
114
|
+
|
115
|
+
st_table *rb_hash_tbl_raw(VALUE hash, const char *file, int line);
|
116
|
+
#define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h, __FILE__, __LINE__)
|
117
|
+
MJIT_SYMBOL_EXPORT_END
|
118
|
+
|
119
|
+
#if 0 /* for debug */
|
120
|
+
|
121
|
+
static inline bool
|
122
|
+
RHASH_AR_TABLE_P(VALUE h)
|
123
|
+
{
|
124
|
+
extern int rb_hash_ar_table_p(VALUE hash);
|
125
|
+
return rb_hash_ar_table_p(h)
|
126
|
+
}
|
127
|
+
|
128
|
+
static inline struct ar_table_struct *
|
129
|
+
RHASH_AR_TABLE(VALUE h)
|
130
|
+
{
|
131
|
+
extern struct ar_table_struct *rb_hash_ar_table(VALUE hash);
|
132
|
+
return rb_hash_ar_table(h)
|
133
|
+
}
|
134
|
+
|
135
|
+
static inline st_table *
|
136
|
+
RHASH_ST_TABLE(VALUE h)
|
137
|
+
{
|
138
|
+
extern st_table *rb_hash_st_table(VALUE hash);
|
139
|
+
return rb_hash_st_table(h)
|
140
|
+
}
|
141
|
+
|
142
|
+
#else
|
143
|
+
|
144
|
+
static inline bool
|
145
|
+
RHASH_AR_TABLE_P(VALUE h)
|
146
|
+
{
|
147
|
+
return ! FL_TEST_RAW(h, RHASH_ST_TABLE_FLAG);
|
148
|
+
}
|
149
|
+
|
150
|
+
static inline struct ar_table_struct *
|
151
|
+
RHASH_AR_TABLE(VALUE h)
|
152
|
+
{
|
153
|
+
return RHASH(h)->as.ar;
|
154
|
+
}
|
155
|
+
|
156
|
+
static inline st_table *
|
157
|
+
RHASH_ST_TABLE(VALUE h)
|
158
|
+
{
|
159
|
+
return RHASH(h)->as.st;
|
160
|
+
}
|
161
|
+
|
162
|
+
#endif
|
163
|
+
|
164
|
+
static inline VALUE
|
165
|
+
RHASH_IFNONE(VALUE h)
|
166
|
+
{
|
167
|
+
return RHASH(h)->ifnone;
|
168
|
+
}
|
169
|
+
|
170
|
+
static inline size_t
|
171
|
+
RHASH_SIZE(VALUE h)
|
172
|
+
{
|
173
|
+
if (RHASH_AR_TABLE_P(h)) {
|
174
|
+
return RHASH_AR_TABLE_SIZE_RAW(h);
|
175
|
+
}
|
176
|
+
else {
|
177
|
+
return RHASH_ST_SIZE(h);
|
178
|
+
}
|
179
|
+
}
|
180
|
+
|
181
|
+
static inline bool
|
182
|
+
RHASH_EMPTY_P(VALUE h)
|
183
|
+
{
|
184
|
+
return RHASH_SIZE(h) == 0;
|
185
|
+
}
|
186
|
+
|
187
|
+
static inline bool
|
188
|
+
RHASH_ST_TABLE_P(VALUE h)
|
189
|
+
{
|
190
|
+
return ! RHASH_AR_TABLE_P(h);
|
191
|
+
}
|
192
|
+
|
193
|
+
static inline size_t
|
194
|
+
RHASH_ST_SIZE(VALUE h)
|
195
|
+
{
|
196
|
+
return RHASH_ST_TABLE(h)->num_entries;
|
197
|
+
}
|
198
|
+
|
199
|
+
static inline void
|
200
|
+
RHASH_ST_CLEAR(VALUE h)
|
201
|
+
{
|
202
|
+
FL_UNSET_RAW(h, RHASH_ST_TABLE_FLAG);
|
203
|
+
RHASH(h)->as.ar = NULL;
|
204
|
+
}
|
205
|
+
|
206
|
+
static inline unsigned
|
207
|
+
RHASH_AR_TABLE_SIZE_RAW(VALUE h)
|
208
|
+
{
|
209
|
+
VALUE ret = FL_TEST_RAW(h, RHASH_AR_TABLE_SIZE_MASK);
|
210
|
+
ret >>= RHASH_AR_TABLE_SIZE_SHIFT;
|
211
|
+
return (unsigned)ret;
|
212
|
+
}
|
213
|
+
|
214
|
+
static inline bool
|
215
|
+
RHASH_TRANSIENT_P(VALUE h)
|
216
|
+
{
|
217
|
+
#if USE_TRANSIENT_HEAP
|
218
|
+
return FL_TEST_RAW(h, RHASH_TRANSIENT_FLAG);
|
219
|
+
#else
|
220
|
+
return false;
|
221
|
+
#endif
|
222
|
+
}
|
223
|
+
|
224
|
+
static inline void
|
225
|
+
RHASH_SET_TRANSIENT_FLAG(VALUE h)
|
226
|
+
{
|
227
|
+
#if USE_TRANSIENT_HEAP
|
228
|
+
FL_SET_RAW(h, RHASH_TRANSIENT_FLAG);
|
229
|
+
#endif
|
230
|
+
}
|
231
|
+
|
232
|
+
static inline void
|
233
|
+
RHASH_UNSET_TRANSIENT_FLAG(VALUE h)
|
234
|
+
{
|
235
|
+
#if USE_TRANSIENT_HEAP
|
236
|
+
FL_UNSET_RAW(h, RHASH_TRANSIENT_FLAG);
|
237
|
+
#endif
|
238
|
+
}
|
239
|
+
|
240
|
+
#endif /* INTERNAL_HASH_H */
|
@@ -0,0 +1,243 @@
|
|
1
|
+
#ifndef INTERNAL_IMEMO_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define INTERNAL_IMEMO_H
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
9
|
+
* file COPYING are met. Consult the file for details.
|
10
|
+
* @brief IMEMO: Internal memo object.
|
11
|
+
*/
|
12
|
+
#include "ruby/internal/config.h"
|
13
|
+
#include <stddef.h> /* for size_t */
|
14
|
+
#include "internal/array.h" /* for rb_ary_tmp_new_fill */
|
15
|
+
#include "internal/gc.h" /* for RB_OBJ_WRITE */
|
16
|
+
#include "ruby/internal/stdbool.h" /* for bool */
|
17
|
+
#include "ruby/ruby.h" /* for rb_block_call_func_t */
|
18
|
+
|
19
|
+
#ifndef IMEMO_DEBUG
|
20
|
+
# define IMEMO_DEBUG 0
|
21
|
+
#endif
|
22
|
+
|
23
|
+
#define IMEMO_MASK 0x0f
|
24
|
+
|
25
|
+
/* FL_USER0 to FL_USER3 is for type */
|
26
|
+
#define IMEMO_FL_USHIFT (FL_USHIFT + 4)
|
27
|
+
#define IMEMO_FL_USER0 FL_USER4
|
28
|
+
#define IMEMO_FL_USER1 FL_USER5
|
29
|
+
#define IMEMO_FL_USER2 FL_USER6
|
30
|
+
#define IMEMO_FL_USER3 FL_USER7
|
31
|
+
#define IMEMO_FL_USER4 FL_USER8
|
32
|
+
#define IMEMO_FL_USER5 FL_USER9
|
33
|
+
|
34
|
+
enum imemo_type {
|
35
|
+
imemo_env = 0,
|
36
|
+
imemo_cref = 1, /*!< class reference */
|
37
|
+
imemo_svar = 2, /*!< special variable */
|
38
|
+
imemo_throw_data = 3,
|
39
|
+
imemo_ifunc = 4, /*!< iterator function */
|
40
|
+
imemo_memo = 5,
|
41
|
+
imemo_ment = 6,
|
42
|
+
imemo_iseq = 7,
|
43
|
+
imemo_tmpbuf = 8,
|
44
|
+
imemo_ast = 9,
|
45
|
+
imemo_parser_strterm = 10,
|
46
|
+
imemo_callinfo = 11,
|
47
|
+
imemo_callcache = 12,
|
48
|
+
};
|
49
|
+
|
50
|
+
/* CREF (Class REFerence) is defined in method.h */
|
51
|
+
|
52
|
+
/*! SVAR (Special VARiable) */
|
53
|
+
struct vm_svar {
|
54
|
+
VALUE flags;
|
55
|
+
const VALUE cref_or_me; /*!< class reference or rb_method_entry_t */
|
56
|
+
const VALUE lastline;
|
57
|
+
const VALUE backref;
|
58
|
+
const VALUE others;
|
59
|
+
};
|
60
|
+
|
61
|
+
/*! THROW_DATA */
|
62
|
+
struct vm_throw_data {
|
63
|
+
VALUE flags;
|
64
|
+
VALUE reserved;
|
65
|
+
const VALUE throw_obj;
|
66
|
+
const struct rb_control_frame_struct *catch_frame;
|
67
|
+
int throw_state;
|
68
|
+
};
|
69
|
+
|
70
|
+
#define THROW_DATA_CONSUMED IMEMO_FL_USER0
|
71
|
+
|
72
|
+
/* IFUNC (Internal FUNCtion) */
|
73
|
+
|
74
|
+
struct vm_ifunc_argc {
|
75
|
+
#if SIZEOF_INT * 2 > SIZEOF_VALUE
|
76
|
+
signed int min: (SIZEOF_VALUE * CHAR_BIT) / 2;
|
77
|
+
signed int max: (SIZEOF_VALUE * CHAR_BIT) / 2;
|
78
|
+
#else
|
79
|
+
int min, max;
|
80
|
+
#endif
|
81
|
+
};
|
82
|
+
|
83
|
+
/*! IFUNC (Internal FUNCtion) */
|
84
|
+
struct vm_ifunc {
|
85
|
+
VALUE flags;
|
86
|
+
VALUE reserved;
|
87
|
+
rb_block_call_func_t func;
|
88
|
+
const void *data;
|
89
|
+
struct vm_ifunc_argc argc;
|
90
|
+
};
|
91
|
+
|
92
|
+
struct rb_imemo_tmpbuf_struct {
|
93
|
+
VALUE flags;
|
94
|
+
VALUE reserved;
|
95
|
+
VALUE *ptr; /* malloc'ed buffer */
|
96
|
+
struct rb_imemo_tmpbuf_struct *next; /* next imemo */
|
97
|
+
size_t cnt; /* buffer size in VALUE */
|
98
|
+
};
|
99
|
+
|
100
|
+
/*! MEMO
|
101
|
+
*
|
102
|
+
* @see imemo_type
|
103
|
+
* */
|
104
|
+
struct MEMO {
|
105
|
+
VALUE flags;
|
106
|
+
VALUE reserved;
|
107
|
+
const VALUE v1;
|
108
|
+
const VALUE v2;
|
109
|
+
union {
|
110
|
+
long cnt;
|
111
|
+
long state;
|
112
|
+
const VALUE value;
|
113
|
+
void (*func)(void);
|
114
|
+
} u3;
|
115
|
+
};
|
116
|
+
|
117
|
+
/* ment is in method.h */
|
118
|
+
|
119
|
+
#define THROW_DATA_P(err) imemo_throw_data_p((VALUE)err)
|
120
|
+
#define MEMO_CAST(m) ((struct MEMO *)(m))
|
121
|
+
#define MEMO_NEW(a, b, c) ((struct MEMO *)rb_imemo_new(imemo_memo, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0))
|
122
|
+
#define MEMO_FOR(type, value) ((type *)RARRAY_PTR(value))
|
123
|
+
#define NEW_MEMO_FOR(type, value) \
|
124
|
+
((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value))
|
125
|
+
#define NEW_PARTIAL_MEMO_FOR(type, value, member) \
|
126
|
+
((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), \
|
127
|
+
rb_ary_set_len((value), offsetof(type, member) / sizeof(VALUE)), \
|
128
|
+
MEMO_FOR(type, value))
|
129
|
+
|
130
|
+
typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t;
|
131
|
+
VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0);
|
132
|
+
rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt);
|
133
|
+
struct vm_ifunc *rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc);
|
134
|
+
void rb_strterm_mark(VALUE obj);
|
135
|
+
static inline enum imemo_type imemo_type(VALUE imemo);
|
136
|
+
static inline int imemo_type_p(VALUE imemo, enum imemo_type imemo_type);
|
137
|
+
static inline bool imemo_throw_data_p(VALUE imemo);
|
138
|
+
static inline struct vm_ifunc *rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data);
|
139
|
+
static inline VALUE rb_imemo_tmpbuf_auto_free_pointer(void);
|
140
|
+
static inline void *RB_IMEMO_TMPBUF_PTR(VALUE v);
|
141
|
+
static inline void *rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr);
|
142
|
+
static inline VALUE rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str);
|
143
|
+
static inline void MEMO_V1_SET(struct MEMO *m, VALUE v);
|
144
|
+
static inline void MEMO_V2_SET(struct MEMO *m, VALUE v);
|
145
|
+
|
146
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
147
|
+
#if IMEMO_DEBUG
|
148
|
+
VALUE rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0, const char *file, int line);
|
149
|
+
#define rb_imemo_new(type, v1, v2, v3, v0) rb_imemo_new_debug(type, v1, v2, v3, v0, __FILE__, __LINE__)
|
150
|
+
#else
|
151
|
+
VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0);
|
152
|
+
#endif
|
153
|
+
const char *rb_imemo_name(enum imemo_type type);
|
154
|
+
RUBY_SYMBOL_EXPORT_END
|
155
|
+
|
156
|
+
static inline enum imemo_type
|
157
|
+
imemo_type(VALUE imemo)
|
158
|
+
{
|
159
|
+
return (RBASIC(imemo)->flags >> FL_USHIFT) & IMEMO_MASK;
|
160
|
+
}
|
161
|
+
|
162
|
+
static inline int
|
163
|
+
imemo_type_p(VALUE imemo, enum imemo_type imemo_type)
|
164
|
+
{
|
165
|
+
if (LIKELY(!RB_SPECIAL_CONST_P(imemo))) {
|
166
|
+
/* fixed at compile time if imemo_type is given. */
|
167
|
+
const VALUE mask = (IMEMO_MASK << FL_USHIFT) | RUBY_T_MASK;
|
168
|
+
const VALUE expected_type = (imemo_type << FL_USHIFT) | T_IMEMO;
|
169
|
+
/* fixed at runtime. */
|
170
|
+
return expected_type == (RBASIC(imemo)->flags & mask);
|
171
|
+
}
|
172
|
+
else {
|
173
|
+
return 0;
|
174
|
+
}
|
175
|
+
}
|
176
|
+
|
177
|
+
#define IMEMO_TYPE_P(v, t) imemo_type_p((VALUE)v, t)
|
178
|
+
|
179
|
+
static inline bool
|
180
|
+
imemo_throw_data_p(VALUE imemo)
|
181
|
+
{
|
182
|
+
return RB_TYPE_P(imemo, T_IMEMO);
|
183
|
+
}
|
184
|
+
|
185
|
+
static inline struct vm_ifunc *
|
186
|
+
rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data)
|
187
|
+
{
|
188
|
+
return rb_vm_ifunc_new(func, data, 0, UNLIMITED_ARGUMENTS);
|
189
|
+
}
|
190
|
+
|
191
|
+
static inline VALUE
|
192
|
+
rb_imemo_tmpbuf_auto_free_pointer(void)
|
193
|
+
{
|
194
|
+
return rb_imemo_new(imemo_tmpbuf, 0, 0, 0, 0);
|
195
|
+
}
|
196
|
+
|
197
|
+
static inline void *
|
198
|
+
RB_IMEMO_TMPBUF_PTR(VALUE v)
|
199
|
+
{
|
200
|
+
const struct rb_imemo_tmpbuf_struct *p = (const void *)v;
|
201
|
+
return p->ptr;
|
202
|
+
}
|
203
|
+
|
204
|
+
static inline void *
|
205
|
+
rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr)
|
206
|
+
{
|
207
|
+
return ((rb_imemo_tmpbuf_t *)v)->ptr = ptr;
|
208
|
+
}
|
209
|
+
|
210
|
+
static inline VALUE
|
211
|
+
rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str)
|
212
|
+
{
|
213
|
+
const void *src;
|
214
|
+
VALUE imemo;
|
215
|
+
rb_imemo_tmpbuf_t *tmpbuf;
|
216
|
+
void *dst;
|
217
|
+
size_t len;
|
218
|
+
|
219
|
+
SafeStringValue(str);
|
220
|
+
/* create tmpbuf to keep the pointer before xmalloc */
|
221
|
+
imemo = rb_imemo_tmpbuf_auto_free_pointer();
|
222
|
+
tmpbuf = (rb_imemo_tmpbuf_t *)imemo;
|
223
|
+
len = RSTRING_LEN(str);
|
224
|
+
src = RSTRING_PTR(str);
|
225
|
+
dst = ruby_xmalloc(len);
|
226
|
+
memcpy(dst, src, len);
|
227
|
+
tmpbuf->ptr = dst;
|
228
|
+
return imemo;
|
229
|
+
}
|
230
|
+
|
231
|
+
static inline void
|
232
|
+
MEMO_V1_SET(struct MEMO *m, VALUE v)
|
233
|
+
{
|
234
|
+
RB_OBJ_WRITE(m, &m->v1, v);
|
235
|
+
}
|
236
|
+
|
237
|
+
static inline void
|
238
|
+
MEMO_V2_SET(struct MEMO *m, VALUE v)
|
239
|
+
{
|
240
|
+
RB_OBJ_WRITE(m, &m->v2, v);
|
241
|
+
}
|
242
|
+
|
243
|
+
#endif /* INTERNAL_IMEMO_H */
|