Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
cf7c15e3
Unverified
Commit
cf7c15e3
authored
Dec 08, 2017
by
Paul Yang
Committed by
GitHub
Dec 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ruby gc_test in ruby 2.4 (#4011)
* Fix ruby gc_test in ruby 2.4 * Initialize global variables to Qnil.
parent
0e7b5895
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
defs.c
ruby/ext/google/protobuf_c/defs.c
+11
-11
map.c
ruby/ext/google/protobuf_c/map.c
+1
-1
repeated_field.c
ruby/ext/google/protobuf_c/repeated_field.c
+1
-1
No files found.
ruby/ext/google/protobuf_c/defs.c
View file @
cf7c15e3
...
...
@@ -76,7 +76,7 @@ static upb_enumdef* check_enum_notfrozen(const upb_enumdef* def) {
// -----------------------------------------------------------------------------
#define DEFINE_CLASS(name, string_name) \
VALUE c ## name
;
\
VALUE c ## name
= Qnil;
\
const rb_data_type_t _ ## name ## _type = { \
string_name, \
{ name ## _mark, name ## _free, NULL }, \
...
...
@@ -126,11 +126,11 @@ void DescriptorPool_register(VALUE module) {
rb_define_method
(
klass
,
"lookup"
,
DescriptorPool_lookup
,
1
);
rb_define_singleton_method
(
klass
,
"generated_pool"
,
DescriptorPool_generated_pool
,
0
);
cDescriptorPool
=
klass
;
rb_gc_register_address
(
&
cDescriptorPool
);
cDescriptorPool
=
klass
;
generated_pool
=
rb_class_new_instance
(
0
,
NULL
,
klass
);
rb_gc_register_address
(
&
generated_pool
);
generated_pool
=
rb_class_new_instance
(
0
,
NULL
,
klass
);
}
static
void
add_descriptor_to_pool
(
DescriptorPool
*
self
,
...
...
@@ -299,8 +299,8 @@ void Descriptor_register(VALUE module) {
rb_define_method
(
klass
,
"name"
,
Descriptor_name
,
0
);
rb_define_method
(
klass
,
"name="
,
Descriptor_name_set
,
1
);
rb_include_module
(
klass
,
rb_mEnumerable
);
cDescriptor
=
klass
;
rb_gc_register_address
(
&
cDescriptor
);
cDescriptor
=
klass
;
}
/*
...
...
@@ -518,8 +518,8 @@ void FieldDescriptor_register(VALUE module) {
rb_define_method
(
klass
,
"subtype"
,
FieldDescriptor_subtype
,
0
);
rb_define_method
(
klass
,
"get"
,
FieldDescriptor_get
,
1
);
rb_define_method
(
klass
,
"set"
,
FieldDescriptor_set
,
2
);
cFieldDescriptor
=
klass
;
rb_gc_register_address
(
&
cFieldDescriptor
);
cFieldDescriptor
=
klass
;
}
/*
...
...
@@ -916,8 +916,8 @@ void OneofDescriptor_register(VALUE module) {
rb_define_method
(
klass
,
"add_field"
,
OneofDescriptor_add_field
,
1
);
rb_define_method
(
klass
,
"each"
,
OneofDescriptor_each
,
0
);
rb_include_module
(
klass
,
rb_mEnumerable
);
cOneofDescriptor
=
klass
;
rb_gc_register_address
(
&
cOneofDescriptor
);
cOneofDescriptor
=
klass
;
}
/*
...
...
@@ -1037,8 +1037,8 @@ void EnumDescriptor_register(VALUE module) {
rb_define_method
(
klass
,
"each"
,
EnumDescriptor_each
,
0
);
rb_define_method
(
klass
,
"enummodule"
,
EnumDescriptor_enummodule
,
0
);
rb_include_module
(
klass
,
rb_mEnumerable
);
cEnumDescriptor
=
klass
;
rb_gc_register_address
(
&
cEnumDescriptor
);
cEnumDescriptor
=
klass
;
}
/*
...
...
@@ -1202,8 +1202,8 @@ void MessageBuilderContext_register(VALUE module) {
rb_define_method
(
klass
,
"repeated"
,
MessageBuilderContext_repeated
,
-
1
);
rb_define_method
(
klass
,
"map"
,
MessageBuilderContext_map
,
-
1
);
rb_define_method
(
klass
,
"oneof"
,
MessageBuilderContext_oneof
,
1
);
cMessageBuilderContext
=
klass
;
rb_gc_register_address
(
&
cMessageBuilderContext
);
cMessageBuilderContext
=
klass
;
}
/*
...
...
@@ -1491,8 +1491,8 @@ void OneofBuilderContext_register(VALUE module) {
rb_define_method
(
klass
,
"initialize"
,
OneofBuilderContext_initialize
,
2
);
rb_define_method
(
klass
,
"optional"
,
OneofBuilderContext_optional
,
-
1
);
cOneofBuilderContext
=
klass
;
rb_gc_register_address
(
&
cOneofBuilderContext
);
cOneofBuilderContext
=
klass
;
}
/*
...
...
@@ -1569,8 +1569,8 @@ void EnumBuilderContext_register(VALUE module) {
rb_define_method
(
klass
,
"initialize"
,
EnumBuilderContext_initialize
,
1
);
rb_define_method
(
klass
,
"value"
,
EnumBuilderContext_value
,
2
);
cEnumBuilderContext
=
klass
;
rb_gc_register_address
(
&
cEnumBuilderContext
);
cEnumBuilderContext
=
klass
;
}
/*
...
...
@@ -1645,8 +1645,8 @@ void Builder_register(VALUE module) {
rb_define_method
(
klass
,
"add_enum"
,
Builder_add_enum
,
1
);
rb_define_method
(
klass
,
"initialize"
,
Builder_initialize
,
0
);
rb_define_method
(
klass
,
"finalize_to_pool"
,
Builder_finalize_to_pool
,
1
);
cBuilder
=
klass
;
rb_gc_register_address
(
&
cBuilder
);
cBuilder
=
klass
;
}
/*
...
...
ruby/ext/google/protobuf_c/map.c
View file @
cf7c15e3
...
...
@@ -825,8 +825,8 @@ VALUE Map_iter_value(Map_iter* iter) {
void
Map_register
(
VALUE
module
)
{
VALUE
klass
=
rb_define_class_under
(
module
,
"Map"
,
rb_cObject
);
rb_define_alloc_func
(
klass
,
Map_alloc
);
cMap
=
klass
;
rb_gc_register_address
(
&
cMap
);
cMap
=
klass
;
rb_define_method
(
klass
,
"initialize"
,
Map_init
,
-
1
);
rb_define_method
(
klass
,
"each"
,
Map_each
,
0
);
...
...
ruby/ext/google/protobuf_c/repeated_field.c
View file @
cf7c15e3
...
...
@@ -626,8 +626,8 @@ void RepeatedField_register(VALUE module) {
VALUE
klass
=
rb_define_class_under
(
module
,
"RepeatedField"
,
rb_cObject
);
rb_define_alloc_func
(
klass
,
RepeatedField_alloc
);
cRepeatedField
=
klass
;
rb_gc_register_address
(
&
cRepeatedField
);
cRepeatedField
=
klass
;
rb_define_method
(
klass
,
"initialize"
,
RepeatedField_init
,
-
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment