(KqueueFacade kqf, int capacity)
| 46 | private long writeAddress; |
| 47 | |
| 48 | public Kqueue(KqueueFacade kqf, int capacity) { |
| 49 | try { |
| 50 | this.kqf = kqf; |
| 51 | this.capacity = capacity; |
| 52 | this.bufferSize = KqueueAccessor.SIZEOF_KEVENT * capacity; |
| 53 | this.changeList = this.writeAddress = Unsafe.calloc(bufferSize, MemoryTag.NATIVE_IO_DISPATCHER_RSS); |
| 54 | this.eventList = this.readAddress = Unsafe.calloc(bufferSize, MemoryTag.NATIVE_IO_DISPATCHER_RSS); |
| 55 | this.kq = Files.createUniqueFd(kqf.kqueue()); |
| 56 | if (kq < 0) { |
| 57 | throw NetworkError.instance(kqf.getNetworkFacade().errno(), "could not create kqueue"); |
| 58 | } |
| 59 | } catch (Throwable t) { |
| 60 | close(); |
| 61 | throw t; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | @Override |
| 66 | public void close() { |
nothing calls this directly
no test coverage detected