event 0.8.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/event/event.c +2 -2
- data/ext/event/extconf.rb +2 -0
- data/ext/event/selector/epoll.c +16 -4
- data/ext/event/selector/kqueue.c +17 -6
- data/ext/event/selector/selector.c +26 -4
- data/ext/event/selector/selector.h +2 -6
- data/ext/event/selector/uring.c +28 -30
- data/lib/event.rb +0 -1
- data/lib/event/selector/select.rb +46 -10
- data/lib/event/version.rb +1 -1
- metadata +3 -10
- data/ext/event/Makefile +0 -267
- data/ext/event/event.bundle +0 -0
- data/ext/event/event.o +0 -0
- data/ext/event/extconf.h +0 -4
- data/ext/event/kqueue.o +0 -0
- data/ext/event/mkmf.log +0 -226
- data/ext/event/selector.o +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df986c171ee38a8b081284b28cb7972f3b7ba96b60d47d370ccac6808fe01ff9
|
4
|
+
data.tar.gz: fd87f66165976f4704e9244f044aedda6a949c87f2879ede07cfc728a24f778e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e522241d001f0d42b364ab51ff0e555c4cbde87daf91f3bedcd93bb8c14ee8a351b413b6156d7f9e94606c3a7536de39fcc71ef2525d85c420c6def51a092cc5
|
7
|
+
data.tar.gz: 297fe75b5789cb10dc32807a2a78bf36514773c1d41646cf1163c6fd7be7ecbedd1239bed631ff825836934dab9fc08eccfb27a2d15d39abb08159b05d01b95c
|
data/ext/event/event.c
CHANGED
@@ -26,9 +26,9 @@ VALUE Event_Selector = Qnil;
|
|
26
26
|
|
27
27
|
void Init_event()
|
28
28
|
{
|
29
|
-
|
29
|
+
#ifdef HAVE_RB_EXT_RACTOR_SAFE
|
30
30
|
rb_ext_ractor_safe(true);
|
31
|
-
|
31
|
+
#endif
|
32
32
|
|
33
33
|
Event = rb_define_module("Event");
|
34
34
|
Event_Selector = rb_define_module_under(Event, "Selector");
|
data/ext/event/extconf.rb
CHANGED
@@ -33,6 +33,7 @@ $CFLAGS << " -Wall"
|
|
33
33
|
$srcs = ["event.c", "selector/selector.c"]
|
34
34
|
$VPATH << "$(srcdir)/selector"
|
35
35
|
|
36
|
+
have_func('rb_ext_ractor_safe')
|
36
37
|
have_func('&rb_fiber_transfer')
|
37
38
|
|
38
39
|
if have_library('uring') and have_header('liburing.h')
|
@@ -49,6 +50,7 @@ end
|
|
49
50
|
|
50
51
|
have_func("rb_io_descriptor")
|
51
52
|
have_func("&rb_process_status_wait")
|
53
|
+
have_func('rb_fiber_current')
|
52
54
|
have_func("&rb_fiber_raise")
|
53
55
|
|
54
56
|
have_header('ruby/io/buffer.h')
|
data/ext/event/selector/epoll.c
CHANGED
@@ -112,12 +112,22 @@ VALUE Event_Selector_EPoll_close(VALUE self) {
|
|
112
112
|
return Qnil;
|
113
113
|
}
|
114
114
|
|
115
|
-
VALUE Event_Selector_EPoll_transfer(
|
115
|
+
VALUE Event_Selector_EPoll_transfer(VALUE self)
|
116
116
|
{
|
117
117
|
struct Event_Selector_EPoll *data = NULL;
|
118
118
|
TypedData_Get_Struct(self, struct Event_Selector_EPoll, &Event_Selector_EPoll_Type, data);
|
119
119
|
|
120
|
-
|
120
|
+
Event_Selector_fiber_transfer(data->backend.loop, 0, NULL);
|
121
|
+
|
122
|
+
return Qnil;
|
123
|
+
}
|
124
|
+
|
125
|
+
VALUE Event_Selector_EPoll_resume(int argc, VALUE *argv, VALUE self)
|
126
|
+
{
|
127
|
+
struct Event_Selector_EPoll *data = NULL;
|
128
|
+
TypedData_Get_Struct(self, struct Event_Selector_EPoll, &Event_Selector_EPoll_Type, data);
|
129
|
+
|
130
|
+
Event_Selector_resume(&data->backend, argc, argv);
|
121
131
|
|
122
132
|
return Qnil;
|
123
133
|
}
|
@@ -522,7 +532,8 @@ VALUE Event_Selector_EPoll_select(VALUE self, VALUE duration) {
|
|
522
532
|
};
|
523
533
|
|
524
534
|
select_internal_with_gvl(&arguments);
|
525
|
-
|
535
|
+
|
536
|
+
// If the ready list was empty and no events were processed:
|
526
537
|
if (!ready && arguments.count == 0) {
|
527
538
|
arguments.timeout = make_timeout(duration);
|
528
539
|
|
@@ -549,7 +560,8 @@ void Init_Event_Selector_EPoll(VALUE Event_Selector) {
|
|
549
560
|
rb_define_alloc_func(Event_Selector_EPoll, Event_Selector_EPoll_allocate);
|
550
561
|
rb_define_method(Event_Selector_EPoll, "initialize", Event_Selector_EPoll_initialize, 1);
|
551
562
|
|
552
|
-
rb_define_method(Event_Selector_EPoll, "transfer", Event_Selector_EPoll_transfer,
|
563
|
+
rb_define_method(Event_Selector_EPoll, "transfer", Event_Selector_EPoll_transfer, 0);
|
564
|
+
rb_define_method(Event_Selector_EPoll, "resume", Event_Selector_EPoll_resume, -1);
|
553
565
|
rb_define_method(Event_Selector_EPoll, "yield", Event_Selector_EPoll_yield, 0);
|
554
566
|
rb_define_method(Event_Selector_EPoll, "push", Event_Selector_EPoll_push, 1);
|
555
567
|
rb_define_method(Event_Selector_EPoll, "raise", Event_Selector_EPoll_raise, -1);
|
data/ext/event/selector/kqueue.c
CHANGED
@@ -112,12 +112,22 @@ VALUE Event_Selector_KQueue_close(VALUE self) {
|
|
112
112
|
return Qnil;
|
113
113
|
}
|
114
114
|
|
115
|
-
VALUE Event_Selector_KQueue_transfer(
|
115
|
+
VALUE Event_Selector_KQueue_transfer(VALUE self)
|
116
116
|
{
|
117
117
|
struct Event_Selector_KQueue *data = NULL;
|
118
118
|
TypedData_Get_Struct(self, struct Event_Selector_KQueue, &Event_Selector_KQueue_Type, data);
|
119
119
|
|
120
|
-
|
120
|
+
Event_Selector_fiber_transfer(data->backend.loop, 0, NULL);
|
121
|
+
|
122
|
+
return Qnil;
|
123
|
+
}
|
124
|
+
|
125
|
+
VALUE Event_Selector_KQueue_resume(int argc, VALUE *argv, VALUE self)
|
126
|
+
{
|
127
|
+
struct Event_Selector_KQueue *data = NULL;
|
128
|
+
TypedData_Get_Struct(self, struct Event_Selector_KQueue, &Event_Selector_KQueue_Type, data);
|
129
|
+
|
130
|
+
return Event_Selector_resume(&data->backend, argc, argv);
|
121
131
|
}
|
122
132
|
|
123
133
|
VALUE Event_Selector_KQueue_yield(VALUE self)
|
@@ -379,7 +389,7 @@ VALUE io_read_loop(VALUE _arguments) {
|
|
379
389
|
offset += result;
|
380
390
|
length -= result;
|
381
391
|
} else if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
382
|
-
Event_Selector_KQueue_io_wait(arguments->self, arguments->fiber, arguments->io, RB_INT2NUM(
|
392
|
+
Event_Selector_KQueue_io_wait(arguments->self, arguments->fiber, arguments->io, RB_INT2NUM(EVENT_READABLE));
|
383
393
|
} else {
|
384
394
|
rb_sys_fail("Event_Selector_KQueue_io_read");
|
385
395
|
}
|
@@ -454,7 +464,7 @@ VALUE io_write_loop(VALUE _arguments) {
|
|
454
464
|
offset += result;
|
455
465
|
length -= result;
|
456
466
|
} else if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
457
|
-
Event_Selector_KQueue_io_wait(arguments->self, arguments->fiber, arguments->io, RB_INT2NUM(
|
467
|
+
Event_Selector_KQueue_io_wait(arguments->self, arguments->fiber, arguments->io, RB_INT2NUM(EVENT_WRITABLE));
|
458
468
|
} else {
|
459
469
|
rb_sys_fail("Event_Selector_KQueue_io_write");
|
460
470
|
}
|
@@ -590,7 +600,7 @@ VALUE Event_Selector_KQueue_select(VALUE self, VALUE duration) {
|
|
590
600
|
select_internal_with_gvl(&arguments);
|
591
601
|
|
592
602
|
// If there were no pending events, if we have a timeout, wait for more events:
|
593
|
-
if (arguments.count == 0
|
603
|
+
if (!ready && arguments.count == 0) {
|
594
604
|
arguments.timeout = make_timeout(duration, &arguments.storage);
|
595
605
|
|
596
606
|
if (!timeout_nonblocking(arguments.timeout)) {
|
@@ -616,7 +626,8 @@ void Init_Event_Selector_KQueue(VALUE Event_Selector) {
|
|
616
626
|
rb_define_alloc_func(Event_Selector_KQueue, Event_Selector_KQueue_allocate);
|
617
627
|
rb_define_method(Event_Selector_KQueue, "initialize", Event_Selector_KQueue_initialize, 1);
|
618
628
|
|
619
|
-
rb_define_method(Event_Selector_KQueue, "transfer", Event_Selector_KQueue_transfer,
|
629
|
+
rb_define_method(Event_Selector_KQueue, "transfer", Event_Selector_KQueue_transfer, 0);
|
630
|
+
rb_define_method(Event_Selector_KQueue, "resume", Event_Selector_KQueue_resume, -1);
|
620
631
|
rb_define_method(Event_Selector_KQueue, "yield", Event_Selector_KQueue_yield, 0);
|
621
632
|
rb_define_method(Event_Selector_KQueue, "push", Event_Selector_KQueue_push, 1);
|
622
633
|
rb_define_method(Event_Selector_KQueue, "raise", Event_Selector_KQueue_raise, -1);
|
@@ -23,11 +23,20 @@
|
|
23
23
|
|
24
24
|
static ID id_transfer, id_alive_p;
|
25
25
|
|
26
|
-
#ifndef HAVE__RB_FIBER_TRANSFER
|
27
26
|
VALUE Event_Selector_fiber_transfer(VALUE fiber, int argc, VALUE *argv) {
|
28
|
-
|
29
|
-
|
27
|
+
// TODO Consider introducing something like `rb_fiber_scheduler_transfer(...)`.
|
28
|
+
#ifdef HAVE__RB_FIBER_TRANSFER
|
29
|
+
if (RTEST(rb_fiber_alive_p(fiber))) {
|
30
|
+
return rb_fiber_transfer(fiber, argc, argv);
|
31
|
+
}
|
32
|
+
#else
|
33
|
+
if (RTEST(rb_funcall(fiber, id_alive_p, 0))) {
|
34
|
+
return rb_funcallv(fiber, id_transfer, argc, argv);
|
35
|
+
}
|
30
36
|
#endif
|
37
|
+
|
38
|
+
return Qnil;
|
39
|
+
}
|
31
40
|
|
32
41
|
#ifndef HAVE__RB_FIBER_RAISE
|
33
42
|
static ID id_raise;
|
@@ -37,6 +46,15 @@ VALUE Event_Selector_fiber_raise(VALUE fiber, int argc, VALUE *argv) {
|
|
37
46
|
}
|
38
47
|
#endif
|
39
48
|
|
49
|
+
#ifndef HAVE_RB_FIBER_CURRENT
|
50
|
+
static ID id_current;
|
51
|
+
|
52
|
+
static VALUE rb_fiber_current() {
|
53
|
+
return rb_funcall(rb_cFiber, id_current, 0);
|
54
|
+
}
|
55
|
+
#endif
|
56
|
+
|
57
|
+
|
40
58
|
#ifndef HAVE_RB_IO_DESCRIPTOR
|
41
59
|
static ID id_fileno;
|
42
60
|
|
@@ -81,6 +99,10 @@ void Init_Event_Selector(VALUE Event_Selector) {
|
|
81
99
|
id_raise = rb_intern("raise");
|
82
100
|
#endif
|
83
101
|
|
102
|
+
#ifndef HAVE_RB_FIBER_CURRENT
|
103
|
+
id_current = rb_intern("current");
|
104
|
+
#endif
|
105
|
+
|
84
106
|
#ifndef HAVE_RB_IO_DESCRIPTOR
|
85
107
|
id_fileno = rb_intern("fileno");
|
86
108
|
#endif
|
@@ -142,7 +164,7 @@ static VALUE wait_and_transfer_ensure(VALUE _arguments) {
|
|
142
164
|
return Qnil;
|
143
165
|
}
|
144
166
|
|
145
|
-
VALUE
|
167
|
+
VALUE Event_Selector_resume(struct Event_Selector *backend, int argc, VALUE *argv)
|
146
168
|
{
|
147
169
|
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
|
148
170
|
|
@@ -38,11 +38,7 @@ enum Event {
|
|
38
38
|
|
39
39
|
void Init_Event_Selector();
|
40
40
|
|
41
|
-
#ifdef HAVE__RB_FIBER_TRANSFER
|
42
|
-
#define Event_Selector_fiber_transfer(fiber, argc, argv) rb_fiber_transfer(fiber, argc, argv)
|
43
|
-
#else
|
44
41
|
VALUE Event_Selector_fiber_transfer(VALUE fiber, int argc, VALUE *argv);
|
45
|
-
#endif
|
46
42
|
|
47
43
|
#ifdef HAVE__RB_FIBER_RAISE
|
48
44
|
#define Event_Selector_fiber_raise(fiber, argc, argv) rb_fiber_raise(fiber, argc, argv)
|
@@ -108,13 +104,13 @@ void Event_Selector_mark(struct Event_Selector *backend) {
|
|
108
104
|
}
|
109
105
|
}
|
110
106
|
|
111
|
-
VALUE
|
107
|
+
VALUE Event_Selector_resume(struct Event_Selector *backend, int argc, VALUE *argv);
|
112
108
|
VALUE Event_Selector_wait_and_raise(struct Event_Selector *backend, int argc, VALUE *argv);
|
113
109
|
|
114
110
|
static inline
|
115
111
|
VALUE Event_Selector_yield(struct Event_Selector *backend)
|
116
112
|
{
|
117
|
-
return
|
113
|
+
return Event_Selector_resume(backend, 1, &backend->loop);
|
118
114
|
}
|
119
115
|
|
120
116
|
void Event_Selector_queue_push(struct Event_Selector *backend, VALUE fiber);
|
data/ext/event/selector/uring.c
CHANGED
@@ -29,9 +29,6 @@
|
|
29
29
|
|
30
30
|
static const int DEBUG = 0;
|
31
31
|
|
32
|
-
// This option controls whether to all `io_uring_submit()` after every operation:
|
33
|
-
static const int EARLY_SUBMIT = 1;
|
34
|
-
|
35
32
|
static VALUE Event_Selector_URing = Qnil;
|
36
33
|
|
37
34
|
enum {URING_ENTRIES = 64};
|
@@ -118,12 +115,22 @@ VALUE Event_Selector_URing_close(VALUE self) {
|
|
118
115
|
return Qnil;
|
119
116
|
}
|
120
117
|
|
121
|
-
VALUE Event_Selector_URing_transfer(
|
118
|
+
VALUE Event_Selector_URing_transfer(VALUE self)
|
119
|
+
{
|
120
|
+
struct Event_Selector_URing *data = NULL;
|
121
|
+
TypedData_Get_Struct(self, struct Event_Selector_URing, &Event_Selector_URing_Type, data);
|
122
|
+
|
123
|
+
Event_Selector_fiber_transfer(data->backend.loop, 0, NULL);
|
124
|
+
|
125
|
+
return Qnil;
|
126
|
+
}
|
127
|
+
|
128
|
+
VALUE Event_Selector_URing_resume(int argc, VALUE *argv, VALUE self)
|
122
129
|
{
|
123
130
|
struct Event_Selector_URing *data = NULL;
|
124
131
|
TypedData_Get_Struct(self, struct Event_Selector_URing, &Event_Selector_URing_Type, data);
|
125
132
|
|
126
|
-
|
133
|
+
Event_Selector_resume(&data->backend, argc, argv);
|
127
134
|
|
128
135
|
return Qnil;
|
129
136
|
}
|
@@ -204,11 +211,7 @@ int io_uring_submit_now(struct Event_Selector_URing *data) {
|
|
204
211
|
|
205
212
|
static
|
206
213
|
void io_uring_submit_pending(struct Event_Selector_URing *data) {
|
207
|
-
|
208
|
-
io_uring_submit_now(data);
|
209
|
-
} else {
|
210
|
-
data->pending += 1;
|
211
|
-
}
|
214
|
+
data->pending += 1;
|
212
215
|
}
|
213
216
|
|
214
217
|
struct io_uring_sqe * io_get_sqe(struct Event_Selector_URing *data) {
|
@@ -346,6 +349,8 @@ VALUE Event_Selector_URing_io_wait(VALUE self, VALUE fiber, VALUE io, VALUE even
|
|
346
349
|
|
347
350
|
io_uring_prep_poll_add(sqe, descriptor, flags);
|
348
351
|
io_uring_sqe_set_data(sqe, (void*)fiber);
|
352
|
+
|
353
|
+
// If we are going to wait, we assume that we are waiting for a while:
|
349
354
|
io_uring_submit_pending(data);
|
350
355
|
|
351
356
|
struct io_wait_arguments io_wait_arguments = {
|
@@ -366,7 +371,7 @@ static int io_read(struct Event_Selector_URing *data, VALUE fiber, int descripto
|
|
366
371
|
|
367
372
|
io_uring_prep_read(sqe, descriptor, buffer, length, 0);
|
368
373
|
io_uring_sqe_set_data(sqe, (void*)fiber);
|
369
|
-
|
374
|
+
io_uring_submit_now(data);
|
370
375
|
|
371
376
|
VALUE result = Event_Selector_fiber_transfer(data->backend.loop, 0, NULL);
|
372
377
|
if (DEBUG) fprintf(stderr, "io_read:Event_Selector_fiber_transfer -> %d\n", RB_NUM2INT(result));
|
@@ -459,7 +464,7 @@ VALUE Event_Selector_URing_io_write(VALUE self, VALUE fiber, VALUE io, VALUE buf
|
|
459
464
|
|
460
465
|
#endif
|
461
466
|
|
462
|
-
static const int ASYNC_CLOSE =
|
467
|
+
static const int ASYNC_CLOSE = 1;
|
463
468
|
|
464
469
|
VALUE Event_Selector_URing_io_close(VALUE self, VALUE io) {
|
465
470
|
struct Event_Selector_URing *data = NULL;
|
@@ -472,10 +477,7 @@ VALUE Event_Selector_URing_io_close(VALUE self, VALUE io) {
|
|
472
477
|
|
473
478
|
io_uring_prep_close(sqe, descriptor);
|
474
479
|
io_uring_sqe_set_data(sqe, NULL);
|
475
|
-
|
476
|
-
io_uring_submit_now(data);
|
477
|
-
else if (ASYNC_CLOSE == 2)
|
478
|
-
io_uring_submit_pending(data);
|
480
|
+
io_uring_submit_now(data);
|
479
481
|
} else {
|
480
482
|
close(descriptor);
|
481
483
|
}
|
@@ -571,16 +573,16 @@ unsigned select_process_completions(struct io_uring *ring) {
|
|
571
573
|
VALUE result = RB_INT2NUM(cqe->res);
|
572
574
|
|
573
575
|
if (DEBUG) fprintf(stderr, "cqe res=%d user_data=%p\n", cqe->res, (void*)cqe->user_data);
|
574
|
-
|
576
|
+
|
575
577
|
io_uring_cq_advance(ring, 1);
|
576
|
-
|
578
|
+
|
577
579
|
Event_Selector_fiber_transfer(fiber, 1, &result);
|
578
580
|
}
|
579
581
|
|
580
582
|
// io_uring_cq_advance(ring, completed);
|
581
|
-
|
583
|
+
|
582
584
|
if (DEBUG) fprintf(stderr, "select_process_completions(completed=%d)\n", completed);
|
583
|
-
|
585
|
+
|
584
586
|
return completed;
|
585
587
|
}
|
586
588
|
|
@@ -588,17 +590,12 @@ VALUE Event_Selector_URing_select(VALUE self, VALUE duration) {
|
|
588
590
|
struct Event_Selector_URing *data = NULL;
|
589
591
|
TypedData_Get_Struct(self, struct Event_Selector_URing, &Event_Selector_URing_Type, data);
|
590
592
|
|
591
|
-
Event_Selector_queue_flush(&data->backend);
|
593
|
+
int ready = Event_Selector_queue_flush(&data->backend);
|
592
594
|
|
593
|
-
int result =
|
594
|
-
|
595
|
-
// There can only be events waiting if we have been submitting them early:
|
596
|
-
if (EARLY_SUBMIT) {
|
597
|
-
result = select_process_completions(&data->ring);
|
598
|
-
}
|
595
|
+
int result = select_process_completions(&data->ring);
|
599
596
|
|
600
|
-
// If
|
601
|
-
if (result == 0) {
|
597
|
+
// If the ready list was empty and we didn't process any completions:
|
598
|
+
if (!ready && result == 0) {
|
602
599
|
// We might need to wait for events:
|
603
600
|
struct select_arguments arguments = {
|
604
601
|
.data = data,
|
@@ -628,7 +625,8 @@ void Init_Event_Selector_URing(VALUE Event_Selector) {
|
|
628
625
|
rb_define_alloc_func(Event_Selector_URing, Event_Selector_URing_allocate);
|
629
626
|
rb_define_method(Event_Selector_URing, "initialize", Event_Selector_URing_initialize, 1);
|
630
627
|
|
631
|
-
rb_define_method(Event_Selector_URing, "transfer", Event_Selector_URing_transfer,
|
628
|
+
rb_define_method(Event_Selector_URing, "transfer", Event_Selector_URing_transfer, 0);
|
629
|
+
rb_define_method(Event_Selector_URing, "resume", Event_Selector_URing_resume, -1);
|
632
630
|
rb_define_method(Event_Selector_URing, "yield", Event_Selector_URing_yield, 0);
|
633
631
|
rb_define_method(Event_Selector_URing, "push", Event_Selector_URing_push, 1);
|
634
632
|
rb_define_method(Event_Selector_URing, "raise", Event_Selector_URing_raise, -1);
|
data/lib/event.rb
CHANGED
@@ -36,30 +36,58 @@ module Event
|
|
36
36
|
@writable = nil
|
37
37
|
end
|
38
38
|
|
39
|
-
|
40
|
-
|
39
|
+
Queue = Struct.new(:fiber) do
|
40
|
+
def transfer(*arguments)
|
41
|
+
fiber&.transfer(*arguments)
|
42
|
+
end
|
43
|
+
|
44
|
+
def alive?
|
45
|
+
fiber&.alive?
|
46
|
+
end
|
47
|
+
|
48
|
+
def nullify
|
49
|
+
self.fiber = nil
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# Transfer from the current fiber to the event loop.
|
54
|
+
def transfer
|
55
|
+
@loop.transfer
|
56
|
+
end
|
57
|
+
|
58
|
+
# Transfer from the current fiber to the specified fiber. Put the current fiber into the ready list.
|
59
|
+
def resume(fiber, *arguments)
|
60
|
+
queue = Queue.new(Fiber.current)
|
61
|
+
@ready.push(queue)
|
62
|
+
|
41
63
|
fiber.transfer(*arguments)
|
42
64
|
ensure
|
43
|
-
|
65
|
+
queue.nullify
|
44
66
|
end
|
45
67
|
|
68
|
+
# Yield from the current fiber back to the event loop. Put the current fiber into the ready list.
|
46
69
|
def yield
|
47
|
-
|
48
|
-
@ready.push(
|
70
|
+
queue = Queue.new(Fiber.current)
|
71
|
+
@ready.push(queue)
|
72
|
+
|
49
73
|
@loop.transfer
|
50
74
|
ensure
|
51
|
-
|
75
|
+
queue.nullify
|
52
76
|
end
|
53
77
|
|
78
|
+
# Append the given fiber into the ready list.
|
54
79
|
def push(fiber)
|
55
80
|
@ready.push(fiber)
|
56
81
|
end
|
57
82
|
|
83
|
+
# Transfer to the given fiber and raise an exception. Put the current fiber into the ready list.
|
58
84
|
def raise(fiber, *arguments)
|
59
|
-
|
60
|
-
@
|
85
|
+
queue = Queue.new(Fiber.current)
|
86
|
+
@ready.push(queue)
|
87
|
+
|
88
|
+
fiber.raise(*arguments)
|
61
89
|
ensure
|
62
|
-
|
90
|
+
queue.nullify
|
63
91
|
end
|
64
92
|
|
65
93
|
def ready?
|
@@ -150,7 +178,7 @@ module Event
|
|
150
178
|
thread&.kill
|
151
179
|
end
|
152
180
|
|
153
|
-
def
|
181
|
+
private def pop_ready
|
154
182
|
if @ready.any?
|
155
183
|
ready = @ready
|
156
184
|
@ready = Array.new
|
@@ -158,6 +186,14 @@ module Event
|
|
158
186
|
ready.each do |fiber|
|
159
187
|
fiber.transfer if fiber.alive?
|
160
188
|
end
|
189
|
+
|
190
|
+
return true
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
def select(duration = nil)
|
195
|
+
if pop_ready
|
196
|
+
duration = 0
|
161
197
|
end
|
162
198
|
|
163
199
|
readable, writable, _ = ::IO.select(@readable.keys, @writable.keys, nil, duration)
|
data/lib/event/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bake
|
@@ -73,16 +73,9 @@ extensions:
|
|
73
73
|
- ext/event/extconf.rb
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- ext/event/Makefile
|
77
|
-
- ext/event/event.bundle
|
78
76
|
- ext/event/event.c
|
79
77
|
- ext/event/event.h
|
80
|
-
- ext/event/event.o
|
81
|
-
- ext/event/extconf.h
|
82
78
|
- ext/event/extconf.rb
|
83
|
-
- ext/event/kqueue.o
|
84
|
-
- ext/event/mkmf.log
|
85
|
-
- ext/event/selector.o
|
86
79
|
- ext/event/selector/epoll.c
|
87
80
|
- ext/event/selector/epoll.h
|
88
81
|
- ext/event/selector/kqueue.c
|
@@ -116,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
109
|
- !ruby/object:Gem::Version
|
117
110
|
version: '0'
|
118
111
|
requirements: []
|
119
|
-
rubygems_version: 3.2.
|
112
|
+
rubygems_version: 3.2.22
|
120
113
|
signing_key:
|
121
114
|
specification_version: 4
|
122
115
|
summary: An event loop.
|
data/ext/event/Makefile
DELETED
@@ -1,267 +0,0 @@
|
|
1
|
-
|
2
|
-
SHELL = /bin/sh
|
3
|
-
|
4
|
-
# V=0 quiet, V=1 verbose. other values don't work.
|
5
|
-
V = 0
|
6
|
-
Q1 = $(V:1=)
|
7
|
-
Q = $(Q1:0=@)
|
8
|
-
ECHO1 = $(V:1=@ :)
|
9
|
-
ECHO = $(ECHO1:0=@ echo)
|
10
|
-
NULLCMD = :
|
11
|
-
|
12
|
-
#### Start of system configuration section. ####
|
13
|
-
|
14
|
-
srcdir = .
|
15
|
-
topdir = /Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0
|
16
|
-
hdrdir = $(topdir)
|
17
|
-
arch_hdrdir = /Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20
|
18
|
-
PATH_SEPARATOR = :
|
19
|
-
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir)/selector
|
20
|
-
prefix = $(DESTDIR)/Users/samuel/.rubies/ruby-3.0.1
|
21
|
-
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
22
|
-
rubyarchprefix = $(rubylibprefix)/$(arch)
|
23
|
-
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
24
|
-
exec_prefix = $(prefix)
|
25
|
-
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
26
|
-
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
27
|
-
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
28
|
-
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
29
|
-
sitehdrdir = $(rubyhdrdir)/site_ruby
|
30
|
-
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
31
|
-
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
32
|
-
vendorlibdir = $(vendordir)/$(ruby_version)
|
33
|
-
vendordir = $(rubylibprefix)/vendor_ruby
|
34
|
-
sitearchdir = $(sitelibdir)/$(sitearch)
|
35
|
-
sitelibdir = $(sitedir)/$(ruby_version)
|
36
|
-
sitedir = $(rubylibprefix)/site_ruby
|
37
|
-
rubyarchdir = $(rubylibdir)/$(arch)
|
38
|
-
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
39
|
-
sitearchincludedir = $(includedir)/$(sitearch)
|
40
|
-
archincludedir = $(includedir)/$(arch)
|
41
|
-
sitearchlibdir = $(libdir)/$(sitearch)
|
42
|
-
archlibdir = $(libdir)/$(arch)
|
43
|
-
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
44
|
-
mandir = $(datarootdir)/man
|
45
|
-
localedir = $(datarootdir)/locale
|
46
|
-
libdir = $(exec_prefix)/lib
|
47
|
-
psdir = $(docdir)
|
48
|
-
pdfdir = $(docdir)
|
49
|
-
dvidir = $(docdir)
|
50
|
-
htmldir = $(docdir)
|
51
|
-
infodir = $(datarootdir)/info
|
52
|
-
docdir = $(datarootdir)/doc/$(PACKAGE)
|
53
|
-
oldincludedir = $(SDKROOT)/usr/include
|
54
|
-
includedir = $(prefix)/include
|
55
|
-
runstatedir = $(localstatedir)/run
|
56
|
-
localstatedir = $(prefix)/var
|
57
|
-
sharedstatedir = $(prefix)/com
|
58
|
-
sysconfdir = $(prefix)/etc
|
59
|
-
datadir = $(datarootdir)
|
60
|
-
datarootdir = $(prefix)/share
|
61
|
-
libexecdir = $(exec_prefix)/libexec
|
62
|
-
sbindir = $(exec_prefix)/sbin
|
63
|
-
bindir = $(exec_prefix)/bin
|
64
|
-
archdir = $(rubyarchdir)
|
65
|
-
|
66
|
-
|
67
|
-
CC_WRAPPER =
|
68
|
-
CC = clang -fdeclspec
|
69
|
-
CXX = clang++ -fdeclspec
|
70
|
-
LIBRUBY = $(LIBRUBY_A)
|
71
|
-
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
72
|
-
LIBRUBYARG_SHARED =
|
73
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework Security -framework Foundation $(MAINLIBS)
|
74
|
-
empty =
|
75
|
-
OUTFLAG = -o $(empty)
|
76
|
-
COUTFLAG = -o $(empty)
|
77
|
-
CSRCFLAG = $(empty)
|
78
|
-
|
79
|
-
RUBY_EXTCONF_H = extconf.h
|
80
|
-
cflags = $(optflags) $(debugflags) $(warnflags)
|
81
|
-
cxxflags =
|
82
|
-
optflags = -O3
|
83
|
-
debugflags = -ggdb3
|
84
|
-
warnflags = -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens
|
85
|
-
cppflags =
|
86
|
-
CCDLFLAGS = -fno-common
|
87
|
-
CFLAGS = $(CCDLFLAGS) $(cflags) -pipe -Wall $(ARCH_FLAG)
|
88
|
-
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
89
|
-
DEFS =
|
90
|
-
CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
|
91
|
-
CXXFLAGS = $(CCDLFLAGS) $(ARCH_FLAG)
|
92
|
-
ldflags = -L. -fstack-protector-strong -L/opt/local/lib
|
93
|
-
dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/opt/local/lib
|
94
|
-
ARCH_FLAG =
|
95
|
-
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
96
|
-
LDSHARED = $(CC) -dynamic -bundle
|
97
|
-
LDSHAREDXX = $(CXX) -dynamic -bundle
|
98
|
-
AR = ar
|
99
|
-
EXEEXT =
|
100
|
-
|
101
|
-
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
102
|
-
RUBY_SO_NAME = ruby.3.0
|
103
|
-
RUBYW_INSTALL_NAME =
|
104
|
-
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
105
|
-
RUBYW_BASE_NAME = rubyw
|
106
|
-
RUBY_BASE_NAME = ruby
|
107
|
-
|
108
|
-
arch = x86_64-darwin20
|
109
|
-
sitearch = $(arch)
|
110
|
-
ruby_version = 3.0.0
|
111
|
-
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
112
|
-
RUBY = $(ruby)
|
113
|
-
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h $(RUBY_EXTCONF_H)
|
114
|
-
|
115
|
-
RM = rm -f
|
116
|
-
RM_RF = $(RUBY) -run -e rm -- -rf
|
117
|
-
RMDIRS = rmdir -p
|
118
|
-
MAKEDIRS = /opt/local/bin/gmkdir -p
|
119
|
-
INSTALL = /usr/bin/install -c
|
120
|
-
INSTALL_PROG = $(INSTALL) -m 0755
|
121
|
-
INSTALL_DATA = $(INSTALL) -m 644
|
122
|
-
COPY = cp
|
123
|
-
TOUCH = exit >
|
124
|
-
|
125
|
-
#### End of system configuration section. ####
|
126
|
-
|
127
|
-
preload =
|
128
|
-
libpath = . $(libdir) /opt/local/lib
|
129
|
-
LIBPATH = -L. -L$(libdir) -L/opt/local/lib
|
130
|
-
DEFFILE =
|
131
|
-
|
132
|
-
CLEANFILES = mkmf.log
|
133
|
-
DISTCLEANFILES =
|
134
|
-
DISTCLEANDIRS =
|
135
|
-
|
136
|
-
extout =
|
137
|
-
extout_prefix =
|
138
|
-
target_prefix = /event
|
139
|
-
LOCAL_LIBS =
|
140
|
-
LIBS =
|
141
|
-
ORIG_SRCS = event.c
|
142
|
-
SRCS = $(ORIG_SRCS) event.c selector.c kqueue.c
|
143
|
-
OBJS = event.o selector.o kqueue.o
|
144
|
-
HDRS = $(srcdir)/event.h $(srcdir)/extconf.h
|
145
|
-
LOCAL_HDRS =
|
146
|
-
TARGET = event
|
147
|
-
TARGET_NAME = event
|
148
|
-
TARGET_ENTRY = Init_$(TARGET_NAME)
|
149
|
-
DLLIB = $(TARGET).bundle
|
150
|
-
EXTSTATIC =
|
151
|
-
STATIC_LIB =
|
152
|
-
|
153
|
-
TIMESTAMP_DIR = .
|
154
|
-
BINDIR = $(bindir)
|
155
|
-
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
156
|
-
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
157
|
-
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
158
|
-
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
159
|
-
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
160
|
-
TARGET_SO_DIR =
|
161
|
-
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
|
162
|
-
CLEANLIBS = $(TARGET_SO)
|
163
|
-
CLEANOBJS = *.o *.bak
|
164
|
-
|
165
|
-
all: $(DLLIB)
|
166
|
-
static: $(STATIC_LIB)
|
167
|
-
.PHONY: all install static install-so install-rb
|
168
|
-
.PHONY: clean clean-so clean-static clean-rb
|
169
|
-
|
170
|
-
clean-static::
|
171
|
-
clean-rb-default::
|
172
|
-
clean-rb::
|
173
|
-
clean-so::
|
174
|
-
clean: clean-so clean-static clean-rb-default clean-rb
|
175
|
-
-$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
|
176
|
-
|
177
|
-
distclean-rb-default::
|
178
|
-
distclean-rb::
|
179
|
-
distclean-so::
|
180
|
-
distclean-static::
|
181
|
-
distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
|
182
|
-
-$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
183
|
-
-$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
184
|
-
-$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
|
185
|
-
|
186
|
-
realclean: distclean
|
187
|
-
install: install-so install-rb
|
188
|
-
|
189
|
-
install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.-.event.time
|
190
|
-
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
191
|
-
clean-static::
|
192
|
-
-$(Q)$(RM) $(STATIC_LIB)
|
193
|
-
install-rb: pre-install-rb do-install-rb install-rb-default
|
194
|
-
install-rb-default: pre-install-rb-default do-install-rb-default
|
195
|
-
pre-install-rb: Makefile
|
196
|
-
pre-install-rb-default: Makefile
|
197
|
-
do-install-rb:
|
198
|
-
do-install-rb-default:
|
199
|
-
pre-install-rb-default:
|
200
|
-
@$(NULLCMD)
|
201
|
-
$(TIMESTAMP_DIR)/.sitearchdir.-.event.time:
|
202
|
-
$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
|
203
|
-
$(Q) $(TOUCH) $@
|
204
|
-
|
205
|
-
site-install: site-install-so site-install-rb
|
206
|
-
site-install-so: install-so
|
207
|
-
site-install-rb: install-rb
|
208
|
-
|
209
|
-
.SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
|
210
|
-
|
211
|
-
.cc.o:
|
212
|
-
$(ECHO) compiling $(<)
|
213
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
214
|
-
|
215
|
-
.cc.S:
|
216
|
-
$(ECHO) translating $(<)
|
217
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
218
|
-
|
219
|
-
.mm.o:
|
220
|
-
$(ECHO) compiling $(<)
|
221
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
222
|
-
|
223
|
-
.mm.S:
|
224
|
-
$(ECHO) translating $(<)
|
225
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
226
|
-
|
227
|
-
.cxx.o:
|
228
|
-
$(ECHO) compiling $(<)
|
229
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
230
|
-
|
231
|
-
.cxx.S:
|
232
|
-
$(ECHO) translating $(<)
|
233
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
234
|
-
|
235
|
-
.cpp.o:
|
236
|
-
$(ECHO) compiling $(<)
|
237
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
238
|
-
|
239
|
-
.cpp.S:
|
240
|
-
$(ECHO) translating $(<)
|
241
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
242
|
-
|
243
|
-
.c.o:
|
244
|
-
$(ECHO) compiling $(<)
|
245
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
246
|
-
|
247
|
-
.c.S:
|
248
|
-
$(ECHO) translating $(<)
|
249
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
250
|
-
|
251
|
-
.m.o:
|
252
|
-
$(ECHO) compiling $(<)
|
253
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
254
|
-
|
255
|
-
.m.S:
|
256
|
-
$(ECHO) translating $(<)
|
257
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
258
|
-
|
259
|
-
$(TARGET_SO): $(OBJS) Makefile
|
260
|
-
$(ECHO) linking shared-object event/$(DLLIB)
|
261
|
-
-$(Q)$(RM) $(@)
|
262
|
-
$(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
263
|
-
$(Q) $(POSTLINK)
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
$(OBJS): $(HDRS) $(ruby_headers)
|
data/ext/event/event.bundle
DELETED
Binary file
|
data/ext/event/event.o
DELETED
Binary file
|
data/ext/event/extconf.h
DELETED
data/ext/event/kqueue.o
DELETED
Binary file
|
data/ext/event/mkmf.log
DELETED
@@ -1,226 +0,0 @@
|
|
1
|
-
have_func: checking for &rb_fiber_transfer()... -------------------- no
|
2
|
-
|
3
|
-
"clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
|
4
|
-
checked program was:
|
5
|
-
/* begin */
|
6
|
-
1: #include "ruby.h"
|
7
|
-
2:
|
8
|
-
3: int main(int argc, char **argv)
|
9
|
-
4: {
|
10
|
-
5: return !!argv[argc];
|
11
|
-
6: }
|
12
|
-
/* end */
|
13
|
-
|
14
|
-
"clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
|
15
|
-
conftest.c:14:76: error: use of undeclared identifier 'rb_fiber_transfer'
|
16
|
-
int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_fiber_transfer; return !p; }
|
17
|
-
^
|
18
|
-
1 error generated.
|
19
|
-
checked program was:
|
20
|
-
/* begin */
|
21
|
-
1: #include "ruby.h"
|
22
|
-
2:
|
23
|
-
3: /*top*/
|
24
|
-
4: extern int t(void);
|
25
|
-
5: int main(int argc, char **argv)
|
26
|
-
6: {
|
27
|
-
7: if (argc > 1000000) {
|
28
|
-
8: int (* volatile tp)(void)=(int (*)(void))&t;
|
29
|
-
9: printf("%d", (*tp)());
|
30
|
-
10: }
|
31
|
-
11:
|
32
|
-
12: return !!argv[argc];
|
33
|
-
13: }
|
34
|
-
14: int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_fiber_transfer; return !p; }
|
35
|
-
/* end */
|
36
|
-
|
37
|
-
--------------------
|
38
|
-
|
39
|
-
have_library: checking for -luring... -------------------- no
|
40
|
-
|
41
|
-
"clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc -luring "
|
42
|
-
ld: library not found for -luring
|
43
|
-
clang: error: linker command failed with exit code 1 (use -v to see invocation)
|
44
|
-
checked program was:
|
45
|
-
/* begin */
|
46
|
-
1: #include "ruby.h"
|
47
|
-
2:
|
48
|
-
3: /*top*/
|
49
|
-
4: extern int t(void);
|
50
|
-
5: int main(int argc, char **argv)
|
51
|
-
6: {
|
52
|
-
7: if (argc > 1000000) {
|
53
|
-
8: int (* volatile tp)(void)=(int (*)(void))&t;
|
54
|
-
9: printf("%d", (*tp)());
|
55
|
-
10: }
|
56
|
-
11:
|
57
|
-
12: return !!argv[argc];
|
58
|
-
13: }
|
59
|
-
14:
|
60
|
-
15: int t(void) { ; return 0; }
|
61
|
-
/* end */
|
62
|
-
|
63
|
-
--------------------
|
64
|
-
|
65
|
-
have_header: checking for sys/epoll.h... -------------------- no
|
66
|
-
|
67
|
-
"clang -E -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -o conftest.i"
|
68
|
-
conftest.c:3:10: fatal error: 'sys/epoll.h' file not found
|
69
|
-
#include <sys/epoll.h>
|
70
|
-
^~~~~~~~~~~~~
|
71
|
-
1 error generated.
|
72
|
-
checked program was:
|
73
|
-
/* begin */
|
74
|
-
1: #include "ruby.h"
|
75
|
-
2:
|
76
|
-
3: #include <sys/epoll.h>
|
77
|
-
/* end */
|
78
|
-
|
79
|
-
--------------------
|
80
|
-
|
81
|
-
have_header: checking for sys/event.h... -------------------- yes
|
82
|
-
|
83
|
-
"clang -E -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -o conftest.i"
|
84
|
-
checked program was:
|
85
|
-
/* begin */
|
86
|
-
1: #include "ruby.h"
|
87
|
-
2:
|
88
|
-
3: #include <sys/event.h>
|
89
|
-
/* end */
|
90
|
-
|
91
|
-
--------------------
|
92
|
-
|
93
|
-
have_func: checking for rb_io_descriptor()... -------------------- no
|
94
|
-
|
95
|
-
"clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
|
96
|
-
conftest.c:14:57: error: use of undeclared identifier 'rb_io_descriptor'
|
97
|
-
int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_io_descriptor; return !p; }
|
98
|
-
^
|
99
|
-
1 error generated.
|
100
|
-
checked program was:
|
101
|
-
/* begin */
|
102
|
-
1: #include "ruby.h"
|
103
|
-
2:
|
104
|
-
3: /*top*/
|
105
|
-
4: extern int t(void);
|
106
|
-
5: int main(int argc, char **argv)
|
107
|
-
6: {
|
108
|
-
7: if (argc > 1000000) {
|
109
|
-
8: int (* volatile tp)(void)=(int (*)(void))&t;
|
110
|
-
9: printf("%d", (*tp)());
|
111
|
-
10: }
|
112
|
-
11:
|
113
|
-
12: return !!argv[argc];
|
114
|
-
13: }
|
115
|
-
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_io_descriptor; return !p; }
|
116
|
-
/* end */
|
117
|
-
|
118
|
-
"clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
|
119
|
-
Undefined symbols for architecture x86_64:
|
120
|
-
"_rb_io_descriptor", referenced from:
|
121
|
-
_t in conftest-839f76.o
|
122
|
-
ld: symbol(s) not found for architecture x86_64
|
123
|
-
clang: error: linker command failed with exit code 1 (use -v to see invocation)
|
124
|
-
checked program was:
|
125
|
-
/* begin */
|
126
|
-
1: #include "ruby.h"
|
127
|
-
2:
|
128
|
-
3: /*top*/
|
129
|
-
4: extern int t(void);
|
130
|
-
5: int main(int argc, char **argv)
|
131
|
-
6: {
|
132
|
-
7: if (argc > 1000000) {
|
133
|
-
8: int (* volatile tp)(void)=(int (*)(void))&t;
|
134
|
-
9: printf("%d", (*tp)());
|
135
|
-
10: }
|
136
|
-
11:
|
137
|
-
12: return !!argv[argc];
|
138
|
-
13: }
|
139
|
-
14: extern void rb_io_descriptor();
|
140
|
-
15: int t(void) { rb_io_descriptor(); return 0; }
|
141
|
-
/* end */
|
142
|
-
|
143
|
-
--------------------
|
144
|
-
|
145
|
-
have_func: checking for &rb_process_status_wait()... -------------------- no
|
146
|
-
|
147
|
-
"clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
|
148
|
-
conftest.c:14:76: error: use of undeclared identifier 'rb_process_status_wait'
|
149
|
-
int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_process_status_wait; return !p; }
|
150
|
-
^
|
151
|
-
1 error generated.
|
152
|
-
checked program was:
|
153
|
-
/* begin */
|
154
|
-
1: #include "ruby.h"
|
155
|
-
2:
|
156
|
-
3: /*top*/
|
157
|
-
4: extern int t(void);
|
158
|
-
5: int main(int argc, char **argv)
|
159
|
-
6: {
|
160
|
-
7: if (argc > 1000000) {
|
161
|
-
8: int (* volatile tp)(void)=(int (*)(void))&t;
|
162
|
-
9: printf("%d", (*tp)());
|
163
|
-
10: }
|
164
|
-
11:
|
165
|
-
12: return !!argv[argc];
|
166
|
-
13: }
|
167
|
-
14: int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_process_status_wait; return !p; }
|
168
|
-
/* end */
|
169
|
-
|
170
|
-
--------------------
|
171
|
-
|
172
|
-
have_func: checking for &rb_fiber_raise()... -------------------- no
|
173
|
-
|
174
|
-
"clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
|
175
|
-
conftest.c:14:76: error: use of undeclared identifier 'rb_fiber_raise'; did you mean 'rb_fiber_resume'?
|
176
|
-
int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_fiber_raise; return !p; }
|
177
|
-
^~~~~~~~~~~~~~
|
178
|
-
rb_fiber_resume
|
179
|
-
/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/internal/intern/cont.h:32:7: note: 'rb_fiber_resume' declared here
|
180
|
-
VALUE rb_fiber_resume(VALUE fib, int argc, const VALUE *argv);
|
181
|
-
^
|
182
|
-
1 error generated.
|
183
|
-
checked program was:
|
184
|
-
/* begin */
|
185
|
-
1: #include "ruby.h"
|
186
|
-
2:
|
187
|
-
3: /*top*/
|
188
|
-
4: extern int t(void);
|
189
|
-
5: int main(int argc, char **argv)
|
190
|
-
6: {
|
191
|
-
7: if (argc > 1000000) {
|
192
|
-
8: int (* volatile tp)(void)=(int (*)(void))&t;
|
193
|
-
9: printf("%d", (*tp)());
|
194
|
-
10: }
|
195
|
-
11:
|
196
|
-
12: return !!argv[argc];
|
197
|
-
13: }
|
198
|
-
14: int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_fiber_raise; return !p; }
|
199
|
-
/* end */
|
200
|
-
|
201
|
-
--------------------
|
202
|
-
|
203
|
-
have_header: checking for ruby/io/buffer.h... -------------------- no
|
204
|
-
|
205
|
-
"clang -E -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -o conftest.i"
|
206
|
-
conftest.c:3:10: fatal error: 'ruby/io/buffer.h' file not found
|
207
|
-
#include <ruby/io/buffer.h>
|
208
|
-
^~~~~~~~~~~~~~~~~~
|
209
|
-
1 error generated.
|
210
|
-
checked program was:
|
211
|
-
/* begin */
|
212
|
-
1: #include "ruby.h"
|
213
|
-
2:
|
214
|
-
3: #include <ruby/io/buffer.h>
|
215
|
-
/* end */
|
216
|
-
|
217
|
-
--------------------
|
218
|
-
|
219
|
-
extconf.h is:
|
220
|
-
/* begin */
|
221
|
-
1: #ifndef EXTCONF_H
|
222
|
-
2: #define EXTCONF_H
|
223
|
-
3: #define HAVE_SYS_EVENT_H 1
|
224
|
-
4: #endif
|
225
|
-
/* end */
|
226
|
-
|
data/ext/event/selector.o
DELETED
Binary file
|