thread_safety 0.1.2 → 0.1.3

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.
@@ -19,20 +19,20 @@ struct rb_gc_vm_context {
19
19
 
20
20
  struct rb_execution_context_struct *ec;
21
21
  };
22
- #endif
23
22
 
24
23
  typedef int (*vm_table_foreach_callback_func)(VALUE value, void *data);
25
24
  typedef int (*vm_table_update_callback_func)(VALUE *value, void *data);
26
25
 
26
+
27
27
  enum rb_gc_vm_weak_tables {
28
28
  RB_GC_VM_CI_TABLE,
29
29
  RB_GC_VM_OVERLOADED_CME_TABLE,
30
30
  RB_GC_VM_GLOBAL_SYMBOLS_TABLE,
31
- RB_GC_VM_ID2REF_TABLE,
32
- RB_GC_VM_GENERIC_FIELDS_TABLE,
31
+ RB_GC_VM_GENERIC_IV_TABLE,
33
32
  RB_GC_VM_FROZEN_STRINGS_TABLE,
34
33
  RB_GC_VM_WEAK_TABLE_COUNT
35
34
  };
35
+ #endif
36
36
 
37
37
  RUBY_SYMBOL_EXPORT_BEGIN
38
38
  unsigned int rb_gc_vm_lock(void);
@@ -44,7 +44,6 @@ void rb_gc_vm_unlock_no_barrier(unsigned int lev);
44
44
  void rb_gc_vm_barrier(void);
45
45
  size_t rb_gc_obj_optimal_size(VALUE obj);
46
46
  void rb_gc_mark_children(void *objspace, VALUE obj);
47
- void rb_gc_vm_weak_table_foreach(vm_table_foreach_callback_func callback, vm_table_update_callback_func update_callback, void *data, bool weak_only, enum rb_gc_vm_weak_tables table);
48
47
  void rb_gc_update_object_references(void *objspace, VALUE obj);
49
48
  void rb_gc_update_vm_references(void *objspace);
50
49
  void rb_gc_event_hook(VALUE obj, rb_event_flag_t event);
@@ -71,7 +70,6 @@ size_t rb_obj_memsize_of(VALUE obj);
71
70
  void rb_gc_prepare_heap_process_object(VALUE obj);
72
71
  bool ruby_free_at_exit_p(void);
73
72
  bool rb_memerror_reentered(void);
74
- bool rb_obj_id_p(VALUE);
75
73
 
76
74
  #if USE_MODULAR_GC
77
75
  bool rb_gc_event_hook_required_p(rb_event_flag_t event);
@@ -79,6 +77,7 @@ void *rb_gc_get_ractor_newobj_cache(void);
79
77
  void rb_gc_initialize_vm_context(struct rb_gc_vm_context *context);
80
78
  void rb_gc_worker_thread_set_vm_context(struct rb_gc_vm_context *context);
81
79
  void rb_gc_worker_thread_unset_vm_context(struct rb_gc_vm_context *context);
80
+ void rb_gc_vm_weak_table_foreach(vm_table_foreach_callback_func callback, vm_table_update_callback_func update_callback, void *data, enum rb_gc_vm_weak_tables table);
82
81
  #endif
83
82
  RUBY_SYMBOL_EXPORT_END
84
83
 
@@ -10,14 +10,6 @@
10
10
  */
11
11
  #include "ruby/ruby.h"
12
12
 
13
- #ifndef RB_GC_OBJECT_METADATA_ENTRY_DEFINED
14
- # define RB_GC_OBJECT_METADATA_ENTRY_DEFINED
15
- struct rb_gc_object_metadata_entry {
16
- ID name;
17
- VALUE val;
18
- };
19
- #endif
20
-
21
13
  #ifdef BUILDING_MODULAR_GC
22
14
  # define GC_IMPL_FN
23
15
  #else
@@ -35,14 +27,14 @@ struct rb_gc_object_metadata_entry {
35
27
  // Bootup
36
28
  GC_IMPL_FN void *rb_gc_impl_objspace_alloc(void);
37
29
  GC_IMPL_FN void rb_gc_impl_objspace_init(void *objspace_ptr);
30
+ GC_IMPL_FN void rb_gc_impl_objspace_free(void *objspace_ptr);
38
31
  GC_IMPL_FN void *rb_gc_impl_ractor_cache_alloc(void *objspace_ptr, void *ractor);
32
+ GC_IMPL_FN void rb_gc_impl_ractor_cache_free(void *objspace_ptr, void *cache);
39
33
  GC_IMPL_FN void rb_gc_impl_set_params(void *objspace_ptr);
40
34
  GC_IMPL_FN void rb_gc_impl_init(void);
41
35
  GC_IMPL_FN size_t *rb_gc_impl_heap_sizes(void *objspace_ptr);
42
36
  // Shutdown
43
37
  GC_IMPL_FN void rb_gc_impl_shutdown_free_objects(void *objspace_ptr);
44
- GC_IMPL_FN void rb_gc_impl_objspace_free(void *objspace_ptr);
45
- GC_IMPL_FN void rb_gc_impl_ractor_cache_free(void *objspace_ptr, void *cache);
46
38
  // GC
47
39
  GC_IMPL_FN void rb_gc_impl_start(void *objspace_ptr, bool full_mark, bool immediate_mark, bool immediate_sweep, bool compact);
48
40
  GC_IMPL_FN bool rb_gc_impl_during_gc_p(void *objspace_ptr);
@@ -116,7 +108,7 @@ GC_IMPL_FN VALUE rb_gc_impl_stat(void *objspace_ptr, VALUE hash_or_sym);
116
108
  GC_IMPL_FN VALUE rb_gc_impl_stat_heap(void *objspace_ptr, VALUE heap_name, VALUE hash_or_sym);
117
109
  GC_IMPL_FN const char *rb_gc_impl_active_gc_name(void);
118
110
  // Miscellaneous
119
- GC_IMPL_FN struct rb_gc_object_metadata_entry *rb_gc_impl_object_metadata(void *objspace_ptr, VALUE obj);
111
+ GC_IMPL_FN size_t rb_gc_impl_obj_flags(void *objspace_ptr, VALUE obj, ID* flags, size_t max);
120
112
  GC_IMPL_FN bool rb_gc_impl_pointer_to_heap_p(void *objspace_ptr, const void *ptr);
121
113
  GC_IMPL_FN bool rb_gc_impl_garbage_object_p(void *objspace_ptr, VALUE obj);
122
114
  GC_IMPL_FN void rb_gc_impl_set_event_hook(void *objspace_ptr, const rb_event_flag_t event);