diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c index 51d1872e8a8f79f3c62609c327a993dea36517fc..4b1015f0fed14d2d1f4f4570f624ef7fef49f3d9 100644 --- a/src/ruby/ext/grpc/rb_grpc.c +++ b/src/ruby/ext/grpc/rb_grpc.c @@ -257,6 +257,11 @@ VALUE grpc_rb_sStatus = Qnil; VALUE grpc_rb_mGRPC = Qnil; VALUE grpc_rb_mGrpcCore = Qnil; +/* cached Symbols for members in Status struct */ +VALUE sym_code = Qundef; +VALUE sym_details = Qundef; +VALUE sym_metadata = Qundef; + void Init_grpc() { grpc_init(); ruby_vm_at_exit(grpc_rb_shutdown); diff --git a/src/ruby/ext/grpc/rb_grpc.h b/src/ruby/ext/grpc/rb_grpc.h index fac4c6d67188d0d2f7ca4027cc48853e36b78dd6..1d411baf5b4280f7efbb449b38297f04df8525cd 100644 --- a/src/ruby/ext/grpc/rb_grpc.h +++ b/src/ruby/ext/grpc/rb_grpc.h @@ -48,13 +48,13 @@ extern VALUE grpc_rb_sNewServerRpc; extern VALUE grpc_rb_sStatus; /* sym_code is the symbol for the code attribute of grpc_rb_sStatus. */ -VALUE sym_code; +extern VALUE sym_code; /* sym_details is the symbol for the details attribute of grpc_rb_sStatus. */ -VALUE sym_details; +extern VALUE sym_details; /* sym_metadata is the symbol for the metadata attribute of grpc_rb_sStatus. */ -VALUE sym_metadata; +extern VALUE sym_metadata; /* GC_NOT_MARKED is used in calls to Data_Wrap_Struct to indicate that the wrapped struct does not need to participate in ruby gc. */