io-event 1.7.0 → 1.7.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 542a0e0f15dd7d59246ac8b03a3579ff9fe8e85618009277572b04a1d1fdbfc9
4
- data.tar.gz: e440cf4f7f2a33a7e7c0b995f4b7829d4d66a44acb3f3d3ca00683b838062fcb
3
+ metadata.gz: b7b49a9181d8917dd2dba7620f964ad0dced4d33ab9a5d725f5493debd927ea6
4
+ data.tar.gz: ce62d1d7c3488ccb39620a66b3c25a12537a586fc0e6b9b9f3263ad662abbcb0
5
5
  SHA512:
6
- metadata.gz: cd577bac5f3b70b70af3ca48f012179ec8d1b1774fc89cd46982fed601fe3a163a9ae9742b58ded385764c5233abc90cbf63f3b2563a114d232233085ba1c5ef
7
- data.tar.gz: ff23dd077067823bd748d89482d39bb1b49cee26e87b6733561d2c3c09ffa3711015d0e8da514ac4851eccd81b84b0e7b66c2d5d7815ade30c551052e0dda536
6
+ metadata.gz: 6c0d875c4ec99d9670d16980ea6b6f92073547b6da089cccab1dc96af6b40f0034a3f3ce6151123acddedb48b808b27782bce638ec93884823a07951fb381f57
7
+ data.tar.gz: fc818ad30b6087149020f7b9fc718c9219b54d19dbfef69c468605c4154d58e0a75d802d1b646829d2a48c8a24d4b4bcdae15a5cea21aa2826d051eb1975f585
checksums.yaml.gz.sig CHANGED
Binary file
@@ -241,7 +241,7 @@ int IO_Event_Selector_EPoll_Descriptor_update(struct IO_Event_Selector_EPoll *se
241
241
  } else {
242
242
  // The IO has changed, we need to reset the state:
243
243
  epoll_descriptor->registered_events = 0;
244
- epoll_descriptor->io = io;
244
+ RB_OBJ_WRITE(selector->backend.self, &epoll_descriptor->io, io);
245
245
  }
246
246
 
247
247
  if (epoll_descriptor->waiting_events == 0) {
@@ -251,7 +251,7 @@ int IO_Event_Selector_EPoll_Descriptor_update(struct IO_Event_Selector_EPoll *se
251
251
  epoll_descriptor->registered_events = 0;
252
252
  }
253
253
 
254
- epoll_descriptor->io = 0;
254
+ RB_OBJ_WRITE(selector->backend.self, &epoll_descriptor->io, 0);
255
255
 
256
256
  return 0;
257
257
  }
@@ -38,6 +38,7 @@ inline static void IO_Event_List_append(struct IO_Event_List *list, struct IO_Ev
38
38
  head->tail = node;
39
39
  }
40
40
 
41
+ // Prepend an item to the beginning of the list.
41
42
  inline static void IO_Event_List_prepend(struct IO_Event_List *list, struct IO_Event_List *node)
42
43
  {
43
44
  assert(node->head == NULL);
@@ -64,6 +65,7 @@ inline static void IO_Event_List_pop(struct IO_Event_List *node)
64
65
  node->head = node->tail = NULL;
65
66
  }
66
67
 
68
+ // Remove an item from the list, if it is in a list.
67
69
  inline static void IO_Event_List_free(struct IO_Event_List *node)
68
70
  {
69
71
  if (node->head && node->tail) {
@@ -71,11 +73,27 @@ inline static void IO_Event_List_free(struct IO_Event_List *node)
71
73
  }
72
74
  }
73
75
 
74
- inline static int IO_Event_List_empty(struct IO_Event_List *list)
76
+ // Calculate the memory size of the list nodes.
77
+ inline static size_t IO_Event_List_memory_size(const struct IO_Event_List *list)
78
+ {
79
+ size_t memsize = 0;
80
+
81
+ const struct IO_Event_List *node = list->tail;
82
+ while (node != list) {
83
+ memsize += sizeof(struct IO_Event_List);
84
+ node = node->tail;
85
+ }
86
+
87
+ return memsize;
88
+ }
89
+
90
+ // Return true if the list is empty.
91
+ inline static int IO_Event_List_empty(const struct IO_Event_List *list)
75
92
  {
76
93
  return list->head == list->tail;
77
94
  }
78
95
 
96
+ // Enumerate all items in the list, assuming the list will not be modified during iteration.
79
97
  inline static void IO_Event_List_immutable_each(struct IO_Event_List *list, void (*callback)(struct IO_Event_List *node))
80
98
  {
81
99
  struct IO_Event_List *node = list->tail;
@@ -287,8 +287,7 @@ void IO_Event_Selector_queue_push(struct IO_Event_Selector *backend, VALUE fiber
287
287
  waiting->tail = NULL;
288
288
  waiting->flags = IO_EVENT_SELECTOR_QUEUE_INTERNAL;
289
289
 
290
- waiting->fiber = fiber;
291
- RB_OBJ_WRITTEN(backend->self, Qundef, fiber);
290
+ RB_OBJ_WRITE(backend->self, &waiting->fiber, fiber);
292
291
 
293
292
  queue_push(backend, waiting);
294
293
  }
@@ -138,6 +138,7 @@ size_t IO_Event_Selector_URing_Type_size(const void *_selector)
138
138
 
139
139
  return sizeof(struct IO_Event_Selector_URing)
140
140
  + IO_Event_Array_memory_size(&selector->completions)
141
+ + IO_Event_List_memory_size(&selector->free_list)
141
142
  ;
142
143
  }
143
144
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  class IO
7
7
  module Event
8
- VERSION = "1.7.0"
8
+ VERSION = "1.7.1"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubygems_version: 3.4.19
107
+ rubygems_version: 3.5.11
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: An event loop.
metadata.gz.sig CHANGED
Binary file