@@ -23,9 +23,9 @@ void *rb_wasm_handle_fiber_unwind(void (**new_fiber_entry)(void *, void *),
23
23
#define RB_WASM_ENABLE_DEBUG_LOG 0
24
24
25
25
#if RB_WASM_ENABLE_DEBUG_LOG
26
- # define RB_WASM_DEBUG_LOG (...) fprintf(stderr, __VA_ARGS__)
26
+ # define RB_WASM_DEBUG_LOG (...) fprintf(stderr, __VA_ARGS__)
27
27
#else
28
- # define RB_WASM_DEBUG_LOG (...) (void)0
28
+ # define RB_WASM_DEBUG_LOG (...) (void)0
29
29
#endif
30
30
31
31
#define RB_WASM_LIB_RT (MAIN_ENTRY ) \
@@ -85,7 +85,8 @@ static VALUE rb_abi_lend_object_internal(VALUE obj) {
85
85
rb_hash_aset (rb_abi_guest_arena_hash , object_id , obj );
86
86
rb_hash_aset (rb_abi_guest_refcount_hash , object_id , INT2FIX (1 ));
87
87
} else {
88
- rb_hash_aset (rb_abi_guest_refcount_hash , object_id , INT2FIX (FIX2INT (ref_count ) + 1 ));
88
+ rb_hash_aset (rb_abi_guest_refcount_hash , object_id ,
89
+ INT2FIX (FIX2INT (ref_count ) + 1 ));
89
90
}
90
91
return Qundef ;
91
92
}
@@ -108,16 +109,19 @@ static VALUE rb_abi_guest_rb_abi_value_dtor_internal(VALUE obj) {
108
109
rb_hash_delete (rb_abi_guest_refcount_hash , object_id );
109
110
rb_hash_delete (rb_abi_guest_arena_hash , object_id );
110
111
} else {
111
- RB_WASM_DEBUG_LOG ("rb_abi_guest_rb_abi_value_dtor: ref_count = %d\n" , FIX2INT (ref_count ));
112
- rb_hash_aset (rb_abi_guest_refcount_hash , object_id , INT2FIX (FIX2INT (ref_count ) - 1 ));
112
+ RB_WASM_DEBUG_LOG ("rb_abi_guest_rb_abi_value_dtor: ref_count = %d\n" ,
113
+ FIX2INT (ref_count ));
114
+ rb_hash_aset (rb_abi_guest_refcount_hash , object_id ,
115
+ INT2FIX (FIX2INT (ref_count ) - 1 ));
113
116
}
114
117
return Qundef ;
115
118
}
116
119
117
120
void rb_abi_guest_rb_abi_value_dtor (void * data ) {
118
121
RB_WASM_DEBUG_LOG ("rb_abi_guest_rb_abi_value_dtor: data = %p\n" , data );
119
122
int state ;
120
- RB_WASM_LIB_RT (rb_protect (rb_abi_guest_rb_abi_value_dtor_internal , (VALUE )data , & state ));
123
+ RB_WASM_LIB_RT (
124
+ rb_protect (rb_abi_guest_rb_abi_value_dtor_internal , (VALUE )data , & state ));
121
125
assert (state == TAG_NONE && "rb_abi_guest_rb_abi_value_dtor_internal failed" );
122
126
}
123
127
@@ -175,7 +179,8 @@ void rb_abi_guest_rb_eval_string_protect(rb_abi_guest_string_t *str,
175
179
VALUE retval ;
176
180
RB_WASM_DEBUG_LOG ("rb_eval_string_protect: str = %s\n" , str -> ptr );
177
181
RB_WASM_LIB_RT (retval = rb_eval_string_protect (str -> ptr , state ));
178
- RB_WASM_DEBUG_LOG ("rb_eval_string_protect: retval = %p, state = %d\n" , (void * )retval , * state );
182
+ RB_WASM_DEBUG_LOG ("rb_eval_string_protect: retval = %p, state = %d\n" ,
183
+ (void * )retval , * state );
179
184
180
185
if (* state == TAG_NONE ) {
181
186
rb_abi_lend_object (retval );
@@ -205,10 +210,11 @@ void rb_abi_guest_rb_funcallv_protect(rb_abi_guest_rb_abi_value_t recv,
205
210
int32_t * ret1 ) {
206
211
VALUE retval ;
207
212
VALUE r_recv = (VALUE )rb_abi_guest_rb_abi_value_get (& recv );
208
- struct rb_funcallv_thunk_ctx ctx = {
209
- .recv = r_recv , .mid = mid , .args = args };
213
+ struct rb_funcallv_thunk_ctx ctx = {.recv = r_recv , .mid = mid , .args = args };
210
214
RB_WASM_LIB_RT (retval = rb_protect (rb_funcallv_thunk , (VALUE )& ctx , ret1 ));
211
- RB_WASM_DEBUG_LOG ("rb_abi_guest_rb_funcallv_protect: retval = %p, state = %d\n" , (void * )retval , * ret1 );
215
+ RB_WASM_DEBUG_LOG (
216
+ "rb_abi_guest_rb_funcallv_protect: retval = %p, state = %d\n" ,
217
+ (void * )retval , * ret1 );
212
218
213
219
if (* ret1 == TAG_NONE ) {
214
220
rb_abi_lend_object (retval );
@@ -227,9 +233,7 @@ rb_abi_guest_rb_abi_value_t rb_abi_guest_rb_errinfo(void) {
227
233
return rb_abi_guest_rb_abi_value_new ((void * )retval );
228
234
}
229
235
230
- void rb_abi_guest_rb_clear_errinfo (void ) {
231
- rb_set_errinfo (Qnil );
232
- }
236
+ void rb_abi_guest_rb_clear_errinfo (void ) { rb_set_errinfo (Qnil ); }
233
237
234
238
void rb_abi_guest_rstring_ptr (rb_abi_guest_rb_abi_value_t value ,
235
239
rb_abi_guest_string_t * ret0 ) {
0 commit comments