Skip to content

Commit

Permalink
Why is this blowing up?
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 22, 2023
1 parent f6ae71c commit 407aaaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/io/event/selector/kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void IO_Event_Selector_KQueue_Waiting_mark(struct IO_Event_List *_waiting)
struct IO_Event_Selector_KQueue_Waiting *waiting = (void*)_waiting;

if (waiting->fiber) {
fprintf(stderr, "Marking fiber: %p\n", (void*)waiting->fiber);
rb_gc_mark_movable(waiting->fiber);
}
}
Expand Down Expand Up @@ -298,6 +299,7 @@ int IO_Event_Selector_KQueue_Waiting_register(struct IO_Event_Selector_KQueue *s
int result = IO_Event_Selector_KQueue_Descriptor_update(selector, identifier, kqueue_descriptor);
if (result == -1) return -1;

fprintf(stderr, "IO_Event_Selector_KQueue_Waiting_register: fiber=%p\n", waiting->fiber);
IO_Event_List_prepend(&kqueue_descriptor->list, &waiting->list);

return result;
Expand All @@ -307,6 +309,7 @@ inline static
void IO_Event_Selector_KQueue_Waiting_cancel(struct IO_Event_Selector_KQueue_Waiting *waiting)
{
IO_Event_List_pop(&waiting->list);
fprintf(stderr, "IO_Event_Selector_KQueue_Waiting_cancel: fiber=%p\n", waiting->fiber);
waiting->fiber = 0;
}

Expand Down
2 changes: 2 additions & 0 deletions ext/io/event/selector/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ inline static void IO_Event_List_pop(struct IO_Event_List *node)
struct IO_Event_List *head = node->head;
struct IO_Event_List *tail = node->tail;

fprintf(stderr, "IO_Event_List_pop: node=%p, head=%p, tail=%p\n", node, head, tail);

head->tail = tail;
tail->head = head;
node->head = node->tail = NULL;
Expand Down

0 comments on commit 407aaaf

Please sign in to comment.