event 0.2.3 → 0.3.0

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: 9a363339a1d384ea4d844450be2ff46cbc091bc0aca240e869491bf6a5d61300
4
- data.tar.gz: b1b3c431481f4499bf6605010392283acfb6f54a59aed232f25217d2cce4a221
3
+ metadata.gz: 0e30a246aa5197439b7c1d9511cd158b56b7f4965ef18a5eaee6057832d5bf8f
4
+ data.tar.gz: d579312da337ed20caf61f0fd6be719874a90b2f43860cc7315244abc59f11e0
5
5
  SHA512:
6
- metadata.gz: 3321631a8be1353038cdc9c63a2b6b17f02ea66924b11f5fb9126f9db1072ea4ee59141858f26e8879e1b52fe265471a2552afcab56cddd84b1e28d1611235d9
7
- data.tar.gz: 7196977bd770153c5be35d16701e32a635c84cf53edf2880b4c5f095b8644825c7dcd1254a4da8f72655fb48e3ac3ec529d2ae2496691fb9ead30bb595cae357
6
+ metadata.gz: b183345fc94fd11872fd10b0401f87330b5334a016c43f4ffe6113c8a4c1f43c89a7eaba6319ff1530dd0f5364cb0a47843781abb45c233f4f9e619f837cdb8e
7
+ data.tar.gz: d702a3aa9ae7792a4d689a9afe23b5c99e93823b59b50de7058b1ff1ffd983b7bba30931b5581397deca8bc11726248c46516e7c933331fdb8c25feaeed7793e
@@ -41,13 +41,19 @@ void Event_Backend_EPoll_Type_mark(void *_data)
41
41
  rb_gc_mark(data->loop);
42
42
  }
43
43
 
44
+ static
45
+ void close_internal(struct Event_Backend_EPoll *data) {
46
+ if (data->descriptor >= 0) {
47
+ close(data->descriptor);
48
+ data->descriptor = -1;
49
+ }
50
+ }
51
+
44
52
  void Event_Backend_EPoll_Type_free(void *_data)
45
53
  {
46
54
  struct Event_Backend_EPoll *data = _data;
47
55
 
48
- if (data->descriptor >= 0) {
49
- close(data->descriptor);
50
- }
56
+ close_internal(data);
51
57
 
52
58
  free(data);
53
59
  }
@@ -96,6 +102,15 @@ VALUE Event_Backend_EPoll_initialize(VALUE self, VALUE loop) {
96
102
  return self;
97
103
  }
98
104
 
105
+ VALUE Event_Backend_EPoll_close(VALUE self) {
106
+ struct Event_Backend_EPoll *data = NULL;
107
+ TypedData_Get_Struct(self, struct Event_Backend_EPoll, &Event_Backend_EPoll_Type, data);
108
+
109
+ close_internal(data);
110
+
111
+ return Qnil;
112
+ }
113
+
99
114
  static inline
100
115
  uint32_t epoll_flags_from_events(int events) {
101
116
  uint32_t flags = 0;
@@ -287,6 +302,7 @@ void Init_Event_Backend_EPoll(VALUE Event_Backend) {
287
302
 
288
303
  rb_define_alloc_func(Event_Backend_EPoll, Event_Backend_EPoll_allocate);
289
304
  rb_define_method(Event_Backend_EPoll, "initialize", Event_Backend_EPoll_initialize, 1);
305
+ rb_define_method(Event_Backend_EPoll, "close", Event_Backend_EPoll_close, 0);
290
306
 
291
307
  rb_define_method(Event_Backend_EPoll, "io_wait", Event_Backend_EPoll_io_wait, 3);
292
308
  rb_define_method(Event_Backend_EPoll, "select", Event_Backend_EPoll_select, 1);
@@ -41,13 +41,19 @@ void Event_Backend_KQueue_Type_mark(void *_data)
41
41
  rb_gc_mark(data->loop);
42
42
  }
43
43
 
44
+ static
45
+ void close_internal(struct Event_Backend_KQueue *data) {
46
+ if (data->descriptor >= 0) {
47
+ close(data->descriptor);
48
+ data->descriptor = -1;
49
+ }
50
+ }
51
+
44
52
  void Event_Backend_KQueue_Type_free(void *_data)
45
53
  {
46
54
  struct Event_Backend_KQueue *data = _data;
47
55
 
48
- if (data->descriptor >= 0) {
49
- close(data->descriptor);
50
- }
56
+ close_internal(data);
51
57
 
52
58
  free(data);
53
59
  }
@@ -97,6 +103,15 @@ VALUE Event_Backend_KQueue_initialize(VALUE self, VALUE loop) {
97
103
  return self;
98
104
  }
99
105
 
106
+ VALUE Event_Backend_KQueue_close(VALUE self) {
107
+ struct Event_Backend_KQueue *data = NULL;
108
+ TypedData_Get_Struct(self, struct Event_Backend_KQueue, &Event_Backend_KQueue_Type, data);
109
+
110
+ close_internal(data);
111
+
112
+ return Qnil;
113
+ }
114
+
100
115
  static
101
116
  int io_add_filters(int descriptor, int ident, int events, VALUE fiber) {
102
117
  int count = 0;
@@ -324,6 +339,7 @@ void Init_Event_Backend_KQueue(VALUE Event_Backend) {
324
339
 
325
340
  rb_define_alloc_func(Event_Backend_KQueue, Event_Backend_KQueue_allocate);
326
341
  rb_define_method(Event_Backend_KQueue, "initialize", Event_Backend_KQueue_initialize, 1);
342
+ rb_define_method(Event_Backend_KQueue, "initialize", Event_Backend_KQueue_close, 0);
327
343
 
328
344
  rb_define_method(Event_Backend_KQueue, "io_wait", Event_Backend_KQueue_io_wait, 3);
329
345
  rb_define_method(Event_Backend_KQueue, "select", Event_Backend_KQueue_select, 1);
@@ -28,8 +28,8 @@
28
28
  static VALUE Event_Backend_URing = Qnil;
29
29
  static ID id_fileno, id_transfer;
30
30
 
31
- enum {URING_ENTRIES = 64};
32
- enum {URING_MAX_EVENTS = 64};
31
+ enum {URING_ENTRIES = 128};
32
+ enum {URING_MAX_EVENTS = 128};
33
33
 
34
34
  struct Event_Backend_URing {
35
35
  VALUE loop;
@@ -42,14 +42,19 @@ void Event_Backend_URing_Type_mark(void *_data)
42
42
  rb_gc_mark(data->loop);
43
43
  }
44
44
 
45
- void Event_Backend_URing_Type_free(void *_data)
46
- {
47
- struct Event_Backend_URing *data = _data;
48
-
45
+ static
46
+ void close_internal(struct Event_Backend_URing *data) {
49
47
  if (data->ring.ring_fd >= 0) {
50
48
  io_uring_queue_exit(&data->ring);
51
49
  data->ring.ring_fd = -1;
52
50
  }
51
+ }
52
+
53
+ void Event_Backend_URing_Type_free(void *_data)
54
+ {
55
+ struct Event_Backend_URing *data = _data;
56
+
57
+ close_internal(data);
53
58
 
54
59
  free(data);
55
60
  }
@@ -97,6 +102,15 @@ VALUE Event_Backend_URing_initialize(VALUE self, VALUE loop) {
97
102
  return self;
98
103
  }
99
104
 
105
+ VALUE Event_Backend_URing_close(VALUE self) {
106
+ struct Event_Backend_URing *data = NULL;
107
+ TypedData_Get_Struct(self, struct Event_Backend_URing, &Event_Backend_URing_Type, data);
108
+
109
+ close_internal(data);
110
+
111
+ return Qnil;
112
+ }
113
+
100
114
  static inline
101
115
  short poll_flags_from_events(int events) {
102
116
  short flags = 0;
@@ -128,12 +142,22 @@ struct io_wait_arguments {
128
142
  short flags;
129
143
  };
130
144
 
145
+ struct io_uring_sqe * io_get_sqe(struct Event_Backend_URing *data) {
146
+ struct io_uring_sqe *sqe = io_uring_get_sqe(&data->ring);
147
+
148
+ while (sqe == NULL) {
149
+ sqe = io_uring_get_sqe(&data->ring);
150
+ }
151
+
152
+ return sqe;
153
+ }
154
+
131
155
  static
132
156
  VALUE io_wait_rescue(VALUE _arguments, VALUE exception) {
133
157
  struct io_wait_arguments *arguments = (struct io_wait_arguments *)_arguments;
134
158
  struct Event_Backend_URing *data = arguments->data;
135
159
 
136
- struct io_uring_sqe *sqe = Event_Backend_URing_io_uring_get_sqe(data);
160
+ struct io_uring_sqe *sqe = io_get_sqe(data);
137
161
 
138
162
  // fprintf(stderr, "poll_remove(%p, %p)\n", sqe, (void*)arguments->fiber);
139
163
 
@@ -157,25 +181,14 @@ VALUE io_wait_transfer(VALUE _arguments) {
157
181
  return INT2NUM(events_from_poll_flags(flags));
158
182
  };
159
183
 
160
- struct io_uring_sqe *Event_Backend_URing_io_uring_get_sqe(struct Event_Backend_URing *data) {
161
- struct io_uring_sqe *sqe = NULL;
162
-
163
- while (true) {
164
- sqe = io_uring_get_sqe(&data->ring);
165
- if (sqe != NULL) {
166
- return sqe;
167
- }
168
- // The sqe is full, we need to poll before submitting more events.
169
- Event_Backend_URing_select(self, INT2NUM(0));
170
- }
171
- }
172
-
173
184
  VALUE Event_Backend_URing_io_wait(VALUE self, VALUE fiber, VALUE io, VALUE events) {
174
185
  struct Event_Backend_URing *data = NULL;
175
186
  TypedData_Get_Struct(self, struct Event_Backend_URing, &Event_Backend_URing_Type, data);
176
187
 
177
188
  int descriptor = NUM2INT(rb_funcall(io, id_fileno, 0));
178
- struct io_uring_sqe *sqe = Event_Backend_URing_io_uring_get_sqe(data);
189
+ struct io_uring_sqe *sqe = io_get_sqe(data);
190
+
191
+ if (!sqe) return INT2NUM(0);
179
192
 
180
193
  short flags = poll_flags_from_events(NUM2INT(events));
181
194
 
@@ -224,7 +237,7 @@ VALUE Event_Backend_URing_io_read(VALUE self, VALUE fiber, VALUE io, VALUE buffe
224
237
  resize_to_capacity(buffer, NUM2SIZET(offset), NUM2SIZET(length));
225
238
 
226
239
  int descriptor = NUM2INT(rb_funcall(io, id_fileno, 0));
227
- struct io_uring_sqe *sqe = Event_Backend_URing_io_uring_get_sqe(data);
240
+ struct io_uring_sqe *sqe = io_get_sqe(data);
228
241
 
229
242
  struct iovec iovecs[1];
230
243
  iovecs[0].iov_base = RSTRING_PTR(buffer) + NUM2SIZET(offset);
@@ -256,7 +269,7 @@ VALUE Event_Backend_URing_io_write(VALUE self, VALUE fiber, VALUE io, VALUE buff
256
269
  }
257
270
 
258
271
  int descriptor = NUM2INT(rb_funcall(io, id_fileno, 0));
259
- struct io_uring_sqe *sqe = Event_Backend_URing_io_uring_get_sqe(data);
272
+ struct io_uring_sqe *sqe = io_get_sqe(data);
260
273
 
261
274
  struct iovec iovecs[1];
262
275
  iovecs[0].iov_base = RSTRING_PTR(buffer) + NUM2SIZET(offset);
@@ -398,6 +411,7 @@ void Init_Event_Backend_URing(VALUE Event_Backend) {
398
411
 
399
412
  rb_define_alloc_func(Event_Backend_URing, Event_Backend_URing_allocate);
400
413
  rb_define_method(Event_Backend_URing, "initialize", Event_Backend_URing_initialize, 1);
414
+ rb_define_method(Event_Backend_URing, "close", Event_Backend_URing_close, 0);
401
415
 
402
416
  rb_define_method(Event_Backend_URing, "io_wait", Event_Backend_URing_io_wait, 3);
403
417
  rb_define_method(Event_Backend_URing, "select", Event_Backend_URing_select, 1);
@@ -28,6 +28,12 @@ module Event
28
28
  @writable = {}
29
29
  end
30
30
 
31
+ def close
32
+ @loop = nil
33
+ @readable = nil
34
+ @writable = nil
35
+ end
36
+
31
37
  def io_wait(fiber, io, events)
32
38
  remove_readable = remove_writable = false
33
39
 
@@ -42,7 +48,6 @@ module Event
42
48
  end
43
49
 
44
50
  @loop.transfer
45
-
46
51
  ensure
47
52
  @readable.delete(io) if remove_readable
48
53
  @writable.delete(io) if remove_writable
@@ -31,6 +31,15 @@ module Event
31
31
  @priority = {}
32
32
  end
33
33
 
34
+ def close
35
+ if @selector.nil?
36
+ raise "Selector already closed!"
37
+ end
38
+
39
+ @selector.close
40
+ @selector = nil
41
+ end
42
+
34
43
  def io_wait(fiber, io, events)
35
44
  register_readable(fiber, io, events)
36
45
  end
data/lib/event/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Event
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.3
4
+ version: 0.3.0
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-05-03 00:00:00.000000000 Z
11
+ date: 2021-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bake
@@ -73,7 +73,6 @@ extensions:
73
73
  - ext/event/extconf.rb
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - ext/event/Makefile
77
76
  - ext/event/backend/backend.h
78
77
  - ext/event/backend/epoll.c
79
78
  - ext/event/backend/epoll.h
@@ -81,14 +80,9 @@ files:
81
80
  - ext/event/backend/kqueue.h
82
81
  - ext/event/backend/uring.c
83
82
  - ext/event/backend/uring.h
84
- - ext/event/event.bundle
85
83
  - ext/event/event.c
86
84
  - ext/event/event.h
87
- - ext/event/event.o
88
- - ext/event/extconf.h
89
85
  - ext/event/extconf.rb
90
- - ext/event/kqueue.o
91
- - ext/event/mkmf.log
92
86
  - lib/event.rb
93
87
  - lib/event/backend/select.rb
94
88
  - lib/event/debug/selector.rb
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.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 kqueue.c
143
- OBJS = event.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
data/ext/event/event.o DELETED
Binary file
data/ext/event/extconf.h DELETED
@@ -1,4 +0,0 @@
1
- #ifndef EXTCONF_H
2
- #define EXTCONF_H
3
- #define HAVE_SYS_EVENT_H 1
4
- #endif
data/ext/event/kqueue.o DELETED
Binary file
data/ext/event/mkmf.log DELETED
@@ -1,73 +0,0 @@
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
-