glib2 3.4.3 → 3.4.7

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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/ext/glib2/extconf.rb +1 -5
  4. data/ext/glib2/glib-enum-types.c +1233 -0
  5. data/ext/glib2/glib-enum-types.h +154 -0
  6. data/ext/glib2/glib2.def +1 -0
  7. data/ext/glib2/rbglib-bytes.c +1 -5
  8. data/ext/glib2/rbglib-gc.c +98 -52
  9. data/ext/glib2/rbglib-variant-type.c +1 -5
  10. data/ext/glib2/rbglib-variant.c +3 -5
  11. data/ext/glib2/rbglib.c +4 -0
  12. data/ext/glib2/rbglib.h +12 -2
  13. data/ext/glib2/rbglib_bookmarkfile.c +1 -1
  14. data/ext/glib2/rbglib_datetime.c +1 -5
  15. data/ext/glib2/rbglib_error.c +21 -2
  16. data/ext/glib2/rbglib_fileutils.c +1 -17
  17. data/ext/glib2/rbglib_iochannel.c +4 -4
  18. data/ext/glib2/rbglib_keyfile.c +1 -35
  19. data/ext/glib2/rbglib_maincontext.c +6 -32
  20. data/ext/glib2/rbglib_mainloop.c +2 -17
  21. data/ext/glib2/rbglib_matchinfo.c +1 -5
  22. data/ext/glib2/rbglib_messages.c +4 -5
  23. data/ext/glib2/rbglib_pollfd.c +1 -25
  24. data/ext/glib2/rbglib_regex.c +1 -13
  25. data/ext/glib2/rbglib_source.c +1 -39
  26. data/ext/glib2/rbglib_spawn.c +5 -10
  27. data/ext/glib2/rbglib_spawnerror.c +2 -2
  28. data/ext/glib2/rbglib_threads.c +2 -15
  29. data/ext/glib2/rbglib_timezone.c +1 -5
  30. data/ext/glib2/rbglib_unichar.c +46 -5
  31. data/ext/glib2/rbglib_unicode.c +1 -18
  32. data/ext/glib2/rbglib_utils.c +1 -14
  33. data/ext/glib2/rbglib_win32.c +3 -7
  34. data/ext/glib2/rbgobj_binding.c +1 -7
  35. data/ext/glib2/rbgobj_closure.c +22 -9
  36. data/ext/glib2/rbgobj_object.c +116 -105
  37. data/ext/glib2/rbgobj_param.c +2 -8
  38. data/ext/glib2/rbgobj_paramspecs.c +6 -24
  39. data/ext/glib2/rbgobj_signal.c +104 -92
  40. data/ext/glib2/rbgobj_strv.c +2 -2
  41. data/ext/glib2/rbgobj_type.c +57 -67
  42. data/ext/glib2/rbgobj_typeinterface.c +38 -2
  43. data/ext/glib2/rbgobj_value.c +3 -7
  44. data/ext/glib2/rbgobj_valuetypes.c +14 -62
  45. data/ext/glib2/rbgobject.c +4 -6
  46. data/ext/glib2/rbgobject.h +2 -27
  47. data/ext/glib2/rbgprivate.h +6 -6
  48. data/ext/glib2/rbgutil_callback.c +23 -26
  49. data/lib/glib2.rb +32 -3
  50. data/lib/glib2/deprecated.rb +22 -1
  51. data/lib/mkmf-gnome.rb +4 -4
  52. data/test/glib-test-utils.rb +18 -3
  53. data/test/run-test.rb +49 -15
  54. data/test/test-binding.rb +1 -11
  55. data/test/test-bytes.rb +1 -5
  56. data/test/test-date-time.rb +1 -3
  57. data/test/{glib-test-init.rb → test-error.rb} +25 -3
  58. data/test/test-file-utils.rb +1 -32
  59. data/test/test-iochannel.rb +3 -5
  60. data/test/test-key-file.rb +5 -6
  61. data/test/test-match-info.rb +1 -5
  62. data/test/test-regex.rb +1 -5
  63. data/test/test-source.rb +1 -14
  64. data/test/test-spawn.rb +2 -1
  65. data/test/test-time-zone.rb +1 -5
  66. data/test/test-timeout.rb +2 -3
  67. data/test/test-unicode.rb +16 -12
  68. data/test/test-utils.rb +2 -8
  69. data/test/test-variant-type.rb +1 -3
  70. data/test/test-win32.rb +6 -6
  71. metadata +6 -5
  72. data/ext/glib2/rbgobj_valuearray.c +0 -100
@@ -0,0 +1,154 @@
1
+
2
+ /* Generated by glib-mkenums.rb ($Id$) */
3
+
4
+ #ifndef __GLIB_ENUM_TYPES_H__
5
+ #define __GLIB_ENUM_TYPES_H__
6
+
7
+ #include <glib-object.h>
8
+
9
+ G_BEGIN_DECLS
10
+
11
+ /* enumerations from "/usr/include/glib-2.0/glib/gvariant.h" */
12
+ GType g_variant_class_get_type (void);
13
+ #define G_TYPE_VARIANT_CLASS (g_variant_class_get_type())
14
+ GType g_variant_parse_error_get_type (void);
15
+ #define G_TYPE_VARIANT_PARSE_ERROR (g_variant_parse_error_get_type())
16
+
17
+ /* enumerations from "/usr/include/glib-2.0/glib/gspawn.h" */
18
+ GType g_spawn_error_get_type (void);
19
+ #define G_TYPE_SPAWN_ERROR (g_spawn_error_get_type())
20
+ GType g_spawn_flags_get_type (void);
21
+ #define G_TYPE_SPAWN_FLAGS (g_spawn_flags_get_type())
22
+
23
+ /* enumerations from "/usr/include/glib-2.0/glib/gkeyfile.h" */
24
+ GType g_key_file_error_get_type (void);
25
+ #define G_TYPE_KEY_FILE_ERROR (g_key_file_error_get_type())
26
+ GType g_key_file_flags_get_type (void);
27
+ #define G_TYPE_KEY_FILE_FLAGS (g_key_file_flags_get_type())
28
+
29
+ /* enumerations from "/usr/include/glib-2.0/glib/gnode.h" */
30
+ GType g_traverse_flags_get_type (void);
31
+ #define G_TYPE_TRAVERSE_FLAGS (g_traverse_flags_get_type())
32
+ GType g_traverse_type_get_type (void);
33
+ #define G_TYPE_TRAVERSE_TYPE (g_traverse_type_get_type())
34
+
35
+ /* enumerations from "/usr/include/glib-2.0/glib/gshell.h" */
36
+ GType g_shell_error_get_type (void);
37
+ #define G_TYPE_SHELL_ERROR (g_shell_error_get_type())
38
+
39
+ /* enumerations from "/usr/include/glib-2.0/glib/gslice.h" */
40
+ GType g_slice_config_get_type (void);
41
+ #define G_TYPE_SLICE_CONFIG (g_slice_config_get_type())
42
+
43
+ /* enumerations from "/usr/include/glib-2.0/glib/gregex.h" */
44
+ GType g_regex_error_get_type (void);
45
+ #define G_TYPE_REGEX_ERROR (g_regex_error_get_type())
46
+ GType g_regex_compile_flags_get_type (void);
47
+ #define G_TYPE_REGEX_COMPILE_FLAGS (g_regex_compile_flags_get_type())
48
+ GType g_regex_match_flags_get_type (void);
49
+ #define G_TYPE_REGEX_MATCH_FLAGS (g_regex_match_flags_get_type())
50
+
51
+ /* enumerations from "/usr/include/glib-2.0/glib/gmarkup.h" */
52
+ GType g_markup_error_get_type (void);
53
+ #define G_TYPE_MARKUP_ERROR (g_markup_error_get_type())
54
+ GType g_markup_parse_flags_get_type (void);
55
+ #define G_TYPE_MARKUP_PARSE_FLAGS (g_markup_parse_flags_get_type())
56
+ GType g_markup_collect_type_get_type (void);
57
+ #define G_TYPE_MARKUP_COLLECT_TYPE (g_markup_collect_type_get_type())
58
+
59
+ /* enumerations from "/usr/include/glib-2.0/glib/gtestutils.h" */
60
+ GType g_test_trap_flags_get_type (void);
61
+ #define G_TYPE_TEST_TRAP_FLAGS (g_test_trap_flags_get_type())
62
+ GType g_test_subprocess_flags_get_type (void);
63
+ #define G_TYPE_TEST_SUBPROCESS_FLAGS (g_test_subprocess_flags_get_type())
64
+ GType g_test_log_type_get_type (void);
65
+ #define G_TYPE_TEST_LOG_TYPE (g_test_log_type_get_type())
66
+ GType g_test_file_type_get_type (void);
67
+ #define G_TYPE_TEST_FILE_TYPE (g_test_file_type_get_type())
68
+
69
+ /* enumerations from "/usr/include/glib-2.0/glib/gfileutils.h" */
70
+ GType g_file_error_get_type (void);
71
+ #define G_TYPE_FILE_ERROR (g_file_error_get_type())
72
+ GType g_file_test_get_type (void);
73
+ #define G_TYPE_FILE_TEST (g_file_test_get_type())
74
+
75
+ /* enumerations from "/usr/include/glib-2.0/glib/gtimezone.h" */
76
+ GType g_time_type_get_type (void);
77
+ #define G_TYPE_TIME_TYPE (g_time_type_get_type())
78
+
79
+ /* enumerations from "/usr/include/glib-2.0/glib/gdate.h" */
80
+ GType g_date_dm_y_get_type (void);
81
+ #define G_TYPE_DATE_DM_Y (g_date_dm_y_get_type())
82
+ GType g_date_weekday_get_type (void);
83
+ #define G_TYPE_DATE_WEEKDAY (g_date_weekday_get_type())
84
+ GType g_date_month_get_type (void);
85
+ #define G_TYPE_DATE_MONTH (g_date_month_get_type())
86
+
87
+ /* enumerations from "/usr/include/glib-2.0/glib/gunicode.h" */
88
+ GType g_unicode_type_get_type (void);
89
+ #define G_TYPE_UNICODE_TYPE (g_unicode_type_get_type())
90
+ GType g_unicode_break_type_get_type (void);
91
+ #define G_TYPE_UNICODE_BREAK_TYPE (g_unicode_break_type_get_type())
92
+ GType g_unicode_script_get_type (void);
93
+ #define G_TYPE_UNICODE_SCRIPT (g_unicode_script_get_type())
94
+ GType g_normalize_mode_get_type (void);
95
+ #define G_TYPE_NORMALIZE_MODE (g_normalize_mode_get_type())
96
+
97
+ /* enumerations from "/usr/include/glib-2.0/glib/ghook.h" */
98
+ GType g_hook_flag_mask_get_type (void);
99
+ #define G_TYPE_HOOK_FLAG_MASK (g_hook_flag_mask_get_type())
100
+
101
+ /* enumerations from "/usr/include/glib-2.0/glib/gthread.h" */
102
+ GType g_thread_error_get_type (void);
103
+ #define G_TYPE_THREAD_ERROR (g_thread_error_get_type())
104
+ GType g_once_status_get_type (void);
105
+ #define G_TYPE_ONCE_STATUS (g_once_status_get_type())
106
+
107
+ /* enumerations from "/usr/include/glib-2.0/glib/gstrfuncs.h" */
108
+ GType g_ascii_type_get_type (void);
109
+ #define G_TYPE_ASCII_TYPE (g_ascii_type_get_type())
110
+
111
+ /* enumerations from "/usr/include/glib-2.0/glib/gmessages.h" */
112
+ GType g_log_level_flags_get_type (void);
113
+ #define G_TYPE_LOG_LEVEL_FLAGS (g_log_level_flags_get_type())
114
+
115
+ /* enumerations from "/usr/include/glib-2.0/glib/gchecksum.h" */
116
+ GType g_checksum_type_get_type (void);
117
+ #define G_TYPE_CHECKSUM_TYPE (g_checksum_type_get_type())
118
+
119
+ /* enumerations from "/usr/include/glib-2.0/glib/gutils.h" */
120
+ GType g_user_directory_get_type (void);
121
+ #define G_TYPE_USER_DIRECTORY (g_user_directory_get_type())
122
+ GType g_format_size_flags_get_type (void);
123
+ #define G_TYPE_FORMAT_SIZE_FLAGS (g_format_size_flags_get_type())
124
+
125
+ /* enumerations from "/usr/include/glib-2.0/glib/goption.h" */
126
+ GType g_option_flags_get_type (void);
127
+ #define G_TYPE_OPTION_FLAGS (g_option_flags_get_type())
128
+ GType g_option_arg_get_type (void);
129
+ #define G_TYPE_OPTION_ARG (g_option_arg_get_type())
130
+ GType g_option_error_get_type (void);
131
+ #define G_TYPE_OPTION_ERROR (g_option_error_get_type())
132
+
133
+ /* enumerations from "/usr/include/glib-2.0/glib/gconvert.h" */
134
+ GType g_convert_error_get_type (void);
135
+ #define G_TYPE_CONVERT_ERROR (g_convert_error_get_type())
136
+
137
+ /* enumerations from "/usr/include/glib-2.0/glib/gbookmarkfile.h" */
138
+ GType g_bookmark_file_error_get_type (void);
139
+ #define G_TYPE_BOOKMARK_FILE_ERROR (g_bookmark_file_error_get_type())
140
+
141
+ /* enumerations from "/usr/include/glib-2.0/gobject/gsignal.h" */
142
+ GType g_signal_flags_get_type (void);
143
+ #define G_TYPE_SIGNAL_FLAGS (g_signal_flags_get_type())
144
+ GType g_connect_flags_get_type (void);
145
+ #define G_TYPE_CONNECT_FLAGS (g_connect_flags_get_type())
146
+ GType g_signal_match_type_get_type (void);
147
+ #define G_TYPE_SIGNAL_MATCH_TYPE (g_signal_match_type_get_type())
148
+
149
+ G_END_DECLS
150
+
151
+ #endif /* __GLIB_ENUM_TYPES_H__ */
152
+
153
+ /* Generated data ends here */
154
+
data/ext/glib2/glib2.def CHANGED
@@ -158,6 +158,7 @@ EXPORTS
158
158
  rbgutil_stop_callback_dispatch_thread
159
159
  rbgutil_string_set_utf8_encoding
160
160
  rbgutil_key_equal
161
+ rbgerr_ruby_error_quark
161
162
  rbgerr_define_gerror
162
163
  rbgerr_gerror2exception
163
164
  rbgobj_convert_define
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2017-2019 Ruby-GNOME Project Team
3
+ * Copyright (C) 2017-2021 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -32,7 +32,6 @@ rbg_is_bytes(VALUE object)
32
32
  return RVAL2CBOOL(rb_obj_is_kind_of(object, RG_TARGET_NAMESPACE));
33
33
  }
34
34
 
35
- #if GLIB_CHECK_VERSION(2, 32, 0)
36
35
  static VALUE RG_TARGET_NAMESPACE;
37
36
 
38
37
  static VALUE
@@ -119,12 +118,10 @@ rg_pointer(VALUE self)
119
118
 
120
119
  return ULONG2NUM((guintptr)data);
121
120
  }
122
- #endif
123
121
 
124
122
  void
125
123
  Init_glib_bytes(void)
126
124
  {
127
- #if GLIB_CHECK_VERSION(2, 32, 0)
128
125
  RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_BYTES, "Bytes", mGLib);
129
126
 
130
127
  RG_DEF_SMETHOD(try_convert, 1);
@@ -135,5 +132,4 @@ Init_glib_bytes(void)
135
132
  RG_DEF_METHOD(size, 0);
136
133
  RG_DEF_ALIAS("length", "size");
137
134
  RG_DEF_METHOD(pointer, 0);
138
- #endif
139
135
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2018-2019 Ruby-GNOME Project Team
3
+ * Copyright (C) 2018-2020 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -20,32 +20,45 @@
20
20
 
21
21
  #include "rbgprivate.h"
22
22
 
23
- static GHashTable *rbg_objects = NULL;
23
+ typedef struct {
24
+ VALUE object;
25
+ guint ref_count;
26
+ } RBGGCMarkItem;
27
+
28
+ typedef struct {
29
+ GHashTable *items;
30
+ GMutex mutex;
31
+ } RBGGCMarker;
32
+
33
+ static RBGGCMarker *rbg_gc_marker_raw = NULL;
24
34
 
25
35
  static void
26
36
  gc_marker_mark_each(G_GNUC_UNUSED gpointer key,
27
37
  gpointer value,
28
38
  G_GNUC_UNUSED gpointer user_data)
29
39
  {
30
- VALUE rb_object = (VALUE)value;
31
- rb_gc_mark(rb_object);
40
+ RBGGCMarkItem *item = value;
41
+ rb_gc_mark(item->object);
32
42
  }
33
43
 
34
44
  static void
35
45
  gc_marker_mark(void *data)
36
46
  {
37
- GHashTable *hash_table = data;
38
- g_hash_table_foreach(hash_table, gc_marker_mark_each, NULL);
47
+ RBGGCMarker *marker = data;
48
+ g_mutex_lock(&(marker->mutex));
49
+ g_hash_table_foreach(marker->items, gc_marker_mark_each, NULL);
50
+ g_mutex_unlock(&(marker->mutex));
39
51
  }
40
52
 
41
53
  static void
42
54
  gc_marker_free(void *data)
43
55
  {
44
- GHashTable *hash_table = data;
45
- g_hash_table_unref(hash_table);
46
- if (hash_table == rbg_objects) {
47
- rbg_objects = NULL;
56
+ RBGGCMarker *marker_raw = data;
57
+ if (marker_raw == rbg_gc_marker_raw) {
58
+ rbg_gc_marker_raw = NULL;
48
59
  }
60
+ g_hash_table_unref(marker_raw->items);
61
+ g_free(marker_raw);
49
62
  }
50
63
 
51
64
  static const rb_data_type_t rbg_gc_marker_type = {
@@ -59,95 +72,128 @@ static const rb_data_type_t rbg_gc_marker_type = {
59
72
  RUBY_TYPED_FREE_IMMEDIATELY,
60
73
  };
61
74
 
62
- void
63
- rbg_gc_guard(gpointer key, VALUE rb_object)
75
+ static VALUE
76
+ rbg_gc_marker_new_raw(void)
64
77
  {
65
- if (!rbg_objects)
66
- return;
78
+ RBGGCMarker *gc_marker_raw = g_new(RBGGCMarker, 1);
79
+ gc_marker_raw->items = g_hash_table_new_full(g_direct_hash,
80
+ g_direct_equal,
81
+ NULL,
82
+ g_free);
83
+ g_mutex_init(&(gc_marker_raw->mutex));
84
+
85
+ return TypedData_Wrap_Struct(rb_cObject,
86
+ &rbg_gc_marker_type,
87
+ gc_marker_raw);
88
+ }
89
+
90
+ static void
91
+ rbg_gc_guard_raw(RBGGCMarker *gc_marker, gpointer key, VALUE rb_object)
92
+ {
93
+ g_mutex_lock(&(gc_marker->mutex));
94
+ RBGGCMarkItem *item = g_hash_table_lookup(gc_marker->items, key);
95
+ if (item) {
96
+ item->ref_count++;
97
+ } else {
98
+ item = g_new(RBGGCMarkItem, 1);
99
+ item->object = rb_object;
100
+ item->ref_count = 1;
101
+ g_hash_table_insert(gc_marker->items, key, item);
102
+ }
103
+ g_mutex_unlock(&(gc_marker->mutex));
104
+ }
67
105
 
68
- g_hash_table_insert(rbg_objects,
69
- key,
70
- (gpointer)rb_object);
106
+ static void
107
+ rbg_gc_unguard_raw(RBGGCMarker *gc_marker, gpointer key)
108
+ {
109
+ g_mutex_lock(&(gc_marker->mutex));
110
+ RBGGCMarkItem *item = g_hash_table_lookup(gc_marker->items, key);
111
+ if (item) {
112
+ item->ref_count--;
113
+ if (item->ref_count == 0) {
114
+ g_hash_table_remove(gc_marker->items, key);
115
+ }
116
+ }
117
+ g_mutex_unlock(&(gc_marker->mutex));
118
+ }
119
+
120
+ static void
121
+ rbg_gc_unguard_all_raw(RBGGCMarker *gc_marker)
122
+ {
123
+ g_mutex_lock(&(gc_marker->mutex));
124
+ g_hash_table_remove_all(gc_marker->items);
125
+ g_mutex_unlock(&(gc_marker->mutex));
71
126
  }
72
127
 
73
128
  void
74
- rbg_gc_unguard(gpointer key)
129
+ rbg_gc_guard(gpointer key, VALUE rb_object)
75
130
  {
76
- if (!rbg_objects)
131
+ if (!rbg_gc_marker_raw)
77
132
  return;
78
133
 
79
- g_hash_table_remove(rbg_objects, key);
134
+ rbg_gc_guard_raw(rbg_gc_marker_raw, key, rb_object);
80
135
  }
81
136
 
82
- static VALUE
83
- rbg_gc_marker_new_raw(GHashTable *rb_objects)
137
+ void
138
+ rbg_gc_unguard(gpointer key)
84
139
  {
85
- VALUE gc_marker;
140
+ if (!rbg_gc_marker_raw)
141
+ return;
86
142
 
87
- gc_marker = TypedData_Wrap_Struct(rb_cData,
88
- &rbg_gc_marker_type,
89
- rb_objects);
90
- return gc_marker;
143
+ rbg_gc_unguard_raw(rbg_gc_marker_raw, key);
91
144
  }
92
145
 
93
146
  VALUE
94
147
  rbg_gc_marker_new(void)
95
148
  {
96
- GHashTable *rb_objects;
97
-
98
- rb_objects = g_hash_table_new(g_direct_hash, g_direct_equal);
99
- return rbg_gc_marker_new_raw(rb_objects);
149
+ return rbg_gc_marker_new_raw();
100
150
  }
101
151
 
102
152
  void
103
153
  rbg_gc_marker_guard(VALUE rb_gc_marker, VALUE rb_object)
104
154
  {
105
- GHashTable *rb_objects;
106
-
155
+ RBGGCMarker *gc_marker;
107
156
  TypedData_Get_Struct(rb_gc_marker,
108
- GHashTable,
157
+ RBGGCMarker,
109
158
  &rbg_gc_marker_type,
110
- rb_objects);
111
- g_hash_table_insert(rb_objects,
112
- (gpointer)rb_object,
113
- (gpointer)rb_object);
159
+ gc_marker);
160
+ rbg_gc_guard_raw(gc_marker, RVAL2POINTER(rb_object), rb_object);
114
161
  }
115
162
 
116
163
  void
117
164
  rbg_gc_marker_unguard(VALUE rb_gc_marker, VALUE rb_object)
118
165
  {
119
- GHashTable *rb_objects;
120
-
121
166
  if (!RB_TYPE_P(rb_gc_marker, RUBY_T_DATA))
122
167
  return;
123
168
  if (!RTYPEDDATA_P(rb_gc_marker))
124
169
  return;
125
170
 
171
+ RBGGCMarker *gc_marker;
126
172
  TypedData_Get_Struct(rb_gc_marker,
127
- GHashTable,
173
+ RBGGCMarker,
128
174
  &rbg_gc_marker_type,
129
- rb_objects);
130
- g_hash_table_remove(rb_objects, (gpointer)rb_object);
175
+ gc_marker);
176
+ rbg_gc_unguard_raw(gc_marker, RVAL2POINTER(rb_object));
131
177
  }
132
178
 
133
179
  void
134
180
  rbg_gc_marker_unguard_all(VALUE rb_gc_marker)
135
181
  {
136
- GHashTable *rb_objects;
137
-
182
+ RBGGCMarker *gc_marker;
138
183
  TypedData_Get_Struct(rb_gc_marker,
139
- GHashTable,
184
+ RBGGCMarker,
140
185
  &rbg_gc_marker_type,
141
- rb_objects);
142
- g_hash_table_remove_all(rb_objects);
186
+ gc_marker);
187
+ rbg_gc_unguard_all_raw(gc_marker);
143
188
  }
144
189
 
145
190
  void
146
191
  Init_glib_gc(void)
147
192
  {
148
- VALUE gc_marker;
149
-
150
- rbg_objects = g_hash_table_new(g_direct_hash, g_direct_equal);
151
- gc_marker = rbg_gc_marker_new_raw(rbg_objects);
193
+ VALUE gc_marker = rbg_gc_marker_new_raw();
152
194
  rb_ivar_set(mGLib, rb_intern("gc_marker"), gc_marker);
195
+ TypedData_Get_Struct(gc_marker,
196
+ RBGGCMarker,
197
+ &rbg_gc_marker_type,
198
+ rbg_gc_marker_raw);
153
199
  }
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2015-2016 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2015-2021 Ruby-GNOME Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -303,14 +303,10 @@ Init_glib_variant_type(void)
303
303
  DEF_TYPE(DICT_ENTRY);
304
304
  DEF_TYPE(DICTIONARY);
305
305
  DEF_TYPE(STRING_ARRAY);
306
- # if GLIB_CHECK_VERSION(2, 30, 0)
307
306
  DEF_TYPE(OBJECT_PATH_ARRAY);
308
- # endif
309
307
  DEF_TYPE(BYTESTRING);
310
308
  DEF_TYPE(BYTESTRING_ARRAY);
311
- # if GLIB_CHECK_VERSION(2, 30, 0)
312
309
  DEF_TYPE(VARDICT);
313
- # endif
314
310
 
315
311
  #undef DEF_TYPE
316
312
  }