event 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1adbb7e42901c2b8d7cd402e48ebf24fc763dd37a0c5e6da48262fd8bb33771a
4
- data.tar.gz: 0a85f5629cadf9eb37813fcaabf16be2e459bdcaff72756640f6dc93f34e00f1
3
+ metadata.gz: db1ee17a5921d3aa6c3ff4314099a1879d4c7ff76f43c3001f6f7872501d1f4c
4
+ data.tar.gz: 3fda0f1769bfc7b489425b9b432d6225772011c8bbaaa34f0dfd5193c8ed940a
5
5
  SHA512:
6
- metadata.gz: c0f0fd8577bb468b2a093b5720c7651eb530f496867ace6caba28ace95abe8f7c45351c7e98feaa45443654521bdea43d8e157547be1d430f42af20232e011e6
7
- data.tar.gz: 7b2230479a18b9d818c1fafa49589f8eea607da8e0283292a807e5d12d15d59f1aa84e6e1d5ac75197474807eeabb0982f15534c98e85cc81ad64c7f7f11dcc7
6
+ metadata.gz: 768501ac864f0436b95050721b14cbf4ce0ba6a3b79d2f0d8e244523477f55fd71f82ae3e7ab088c94aa40a6d0200acc4138caff472c95426a01fa784a50911c
7
+ data.tar.gz: f876ffe91ed99aa0e013ddaed5e2c4e6a72724891cc3bdceae9cb3bb1b30909716c92b8d551d23a171870b2e548dec32455de028bf5ea60964969d4aed919a9a
@@ -0,0 +1,267 @@
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.0/include/ruby-3.0.0
16
+ hdrdir = $(topdir)
17
+ arch_hdrdir = /Users/samuel/.rubies/ruby-3.0.0/include/ruby-3.0.0/x86_64-darwin20
18
+ PATH_SEPARATOR = :
19
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir)/backend
20
+ prefix = $(DESTDIR)/Users/samuel/.rubies/ruby-3.0.0
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 backend.c kqueue.c
143
+ OBJS = event.o backend.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)
Binary file
@@ -0,0 +1,39 @@
1
+ // Copyright, 2021, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ // of this software and associated documentation files (the "Software"), to deal
5
+ // in the Software without restriction, including without limitation the rights
6
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ // copies of the Software, and to permit persons to whom the Software is
8
+ // furnished to do so, subject to the following conditions:
9
+ //
10
+ // The above copyright notice and this permission notice shall be included in
11
+ // all copies or substantial portions of the Software.
12
+ //
13
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ // THE SOFTWARE.
20
+
21
+ #include "backend.h"
22
+
23
+ static ID id_transfer, id_alive_p;
24
+
25
+ void Init_Event_Backend(VALUE Event_Backend) {
26
+ id_transfer = rb_intern("transfer");
27
+ id_alive_p = rb_intern("alive?");
28
+ }
29
+
30
+ VALUE
31
+ Event_Backend_resume_safe(VALUE fiber, VALUE result) {
32
+ VALUE alive = rb_funcall(fiber, id_alive_p, 0);
33
+
34
+ if (RTEST(alive)) {
35
+ return rb_funcall(fiber, id_transfer, 1, result);
36
+ } else {
37
+ return Qnil;
38
+ }
39
+ }
@@ -18,6 +18,9 @@
18
18
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  // THE SOFTWARE.
20
20
 
21
+ #include <ruby.h>
22
+ #include <ruby/thread.h>
23
+
21
24
  enum Event {
22
25
  READABLE = 1,
23
26
  PRIORITY = 2,
@@ -26,4 +29,8 @@ enum Event {
26
29
  HANGUP = 16
27
30
  };
28
31
 
29
- #include <ruby/thread.h>
32
+ void
33
+ Init_Event_Backend();
34
+
35
+ VALUE
36
+ Event_Backend_resume_safe(VALUE fiber, VALUE argument);
@@ -288,7 +288,7 @@ VALUE Event_Backend_EPoll_select(VALUE self, VALUE duration) {
288
288
 
289
289
  // fprintf(stderr, "-> fiber=%p descriptor=%d\n", (void*)fiber, events[i].data.fd);
290
290
 
291
- rb_funcall(fiber, id_transfer, 1, result);
291
+ Event_Backend_resume_safe(fiber, result);
292
292
  }
293
293
 
294
294
  return INT2NUM(arguments.count);
@@ -325,7 +325,8 @@ VALUE Event_Backend_KQueue_select(VALUE self, VALUE duration) {
325
325
  for (int i = 0; i < arguments.count; i += 1) {
326
326
  VALUE fiber = (VALUE)arguments.events[i].udata;
327
327
  VALUE result = INT2NUM(arguments.events[i].filter);
328
- rb_funcall(fiber, id_transfer, 1, result);
328
+
329
+ Event_Backend_resume_safe(fiber, result);
329
330
  }
330
331
 
331
332
  return INT2NUM(arguments.count);
@@ -397,7 +397,7 @@ VALUE Event_Backend_URing_select(VALUE self, VALUE duration) {
397
397
 
398
398
  io_uring_cqe_seen(&data->ring, cqes[i]);
399
399
 
400
- rb_funcall(fiber, id_transfer, 1, result);
400
+ Event_Backend_resume_safe(fiber, result);
401
401
  }
402
402
 
403
403
  return INT2NUM(result);
Binary file
data/ext/event/event.c CHANGED
@@ -19,6 +19,7 @@
19
19
  // THE SOFTWARE.
20
20
 
21
21
  #include "event.h"
22
+ #include "backend/backend.h"
22
23
 
23
24
  VALUE Event = Qnil;
24
25
  VALUE Event_Backend = Qnil;
@@ -32,6 +33,8 @@ void Init_event()
32
33
  Event = rb_define_module("Event");
33
34
  Event_Backend = rb_define_module_under(Event, "Backend");
34
35
 
36
+ Init_Event_Backend(Event_Backend);
37
+
35
38
  #ifdef EVENT_BACKEND_URING
36
39
  Init_Event_Backend_URing(Event_Backend);
37
40
  #endif
data/ext/event/event.o ADDED
Binary file
@@ -0,0 +1,4 @@
1
+ #ifndef EXTCONF_H
2
+ #define EXTCONF_H
3
+ #define HAVE_SYS_EVENT_H 1
4
+ #endif
data/ext/event/extconf.rb CHANGED
@@ -30,7 +30,7 @@ dir_config(extension_name)
30
30
 
31
31
  $CFLAGS << " -Wall"
32
32
 
33
- $srcs = ["event.c"]
33
+ $srcs = ["event.c", "backend/backend.c"]
34
34
  $VPATH << "$(srcdir)/backend"
35
35
 
36
36
  if have_library('uring') and have_header('liburing.h')
Binary file
@@ -0,0 +1,73 @@
1
+ have_library: checking for -luring... -------------------- no
2
+
3
+ "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.0/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.0/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.0/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.0/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.0/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.0/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.0/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.0/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 "
15
+ ld: library not found for -luring
16
+ clang: error: linker command failed with exit code 1 (use -v to see invocation)
17
+ checked program was:
18
+ /* begin */
19
+ 1: #include "ruby.h"
20
+ 2:
21
+ 3: /*top*/
22
+ 4: extern int t(void);
23
+ 5: int main(int argc, char **argv)
24
+ 6: {
25
+ 7: if (argc > 1000000) {
26
+ 8: int (* volatile tp)(void)=(int (*)(void))&t;
27
+ 9: printf("%d", (*tp)());
28
+ 10: }
29
+ 11:
30
+ 12: return !!argv[argc];
31
+ 13: }
32
+ 14:
33
+ 15: int t(void) { ; return 0; }
34
+ /* end */
35
+
36
+ --------------------
37
+
38
+ have_header: checking for sys/epoll.h... -------------------- no
39
+
40
+ "clang -E -I/Users/samuel/.rubies/ruby-3.0.0/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.0/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.0/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"
41
+ conftest.c:3:10: fatal error: 'sys/epoll.h' file not found
42
+ #include <sys/epoll.h>
43
+ ^~~~~~~~~~~~~
44
+ 1 error generated.
45
+ checked program was:
46
+ /* begin */
47
+ 1: #include "ruby.h"
48
+ 2:
49
+ 3: #include <sys/epoll.h>
50
+ /* end */
51
+
52
+ --------------------
53
+
54
+ have_header: checking for sys/event.h... -------------------- yes
55
+
56
+ "clang -E -I/Users/samuel/.rubies/ruby-3.0.0/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.0/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.0/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"
57
+ checked program was:
58
+ /* begin */
59
+ 1: #include "ruby.h"
60
+ 2:
61
+ 3: #include <sys/event.h>
62
+ /* end */
63
+
64
+ --------------------
65
+
66
+ extconf.h is:
67
+ /* begin */
68
+ 1: #ifndef EXTCONF_H
69
+ 2: #define EXTCONF_H
70
+ 3: #define HAVE_SYS_EVENT_H 1
71
+ 4: #endif
72
+ /* end */
73
+
@@ -69,7 +69,7 @@ module Event
69
69
  end
70
70
 
71
71
  ready.each do |fiber, events|
72
- fiber.transfer(events)
72
+ fiber.transfer(events) if fiber.alive?
73
73
  end
74
74
  end
75
75
  end
data/lib/event/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Event
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -73,6 +73,9 @@ extensions:
73
73
  - ext/event/extconf.rb
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - ext/event/Makefile
77
+ - ext/event/backend.o
78
+ - ext/event/backend/backend.c
76
79
  - ext/event/backend/backend.h
77
80
  - ext/event/backend/epoll.c
78
81
  - ext/event/backend/epoll.h
@@ -80,9 +83,14 @@ files:
80
83
  - ext/event/backend/kqueue.h
81
84
  - ext/event/backend/uring.c
82
85
  - ext/event/backend/uring.h
86
+ - ext/event/event.bundle
83
87
  - ext/event/event.c
84
88
  - ext/event/event.h
89
+ - ext/event/event.o
90
+ - ext/event/extconf.h
85
91
  - ext/event/extconf.rb
92
+ - ext/event/kqueue.o
93
+ - ext/event/mkmf.log
86
94
  - lib/event.rb
87
95
  - lib/event/backend.rb
88
96
  - lib/event/backend/select.rb
@@ -108,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
116
  - !ruby/object:Gem::Version
109
117
  version: '0'
110
118
  requirements: []
111
- rubygems_version: 3.1.2
119
+ rubygems_version: 3.2.3
112
120
  signing_key:
113
121
  specification_version: 4
114
122
  summary: An event loop.