Package io.netty.channel.kqueue
Class KQueueEventArray
- java.lang.Object
-
- io.netty.channel.kqueue.KQueueEventArray
-
final class KQueueEventArray extends java.lang.Object
Represents an array of kevent structures, backed by offheap memory.struct kevent { uintptr_t ident; short keventFilter; u_short flags; u_int fflags; intptr_t data; void *udata; };
-
-
Field Summary
Fields Modifier and Type Field Description private int
capacity
private static int
KQUEUE_DATA_OFFSET
private static int
KQUEUE_EVENT_SIZE
private static int
KQUEUE_FFLAGS_OFFSET
private static int
KQUEUE_FILTER_OFFSET
private static int
KQUEUE_FLAGS_OFFSET
private static int
KQUEUE_IDENT_OFFSET
private static int
KQUEUE_UDATA_OFFSET
private java.nio.ByteBuffer
memory
private long
memoryAddress
private int
size
-
Constructor Summary
Constructors Constructor Description KQueueEventArray(int capacity)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
calculateBufferCapacity(int capacity)
(package private) int
capacity()
Return the capacity of theKQueueEventArray
which represent the maximum number ofkevent
s that can be stored in it.(package private) void
clear()
(package private) long
data(int index)
(package private) void
evSet(int ident, short filter, short flags, int fflags, long data, long udata)
private static void
evSet(long keventAddress, int ident, short filter, short flags, int fflags, long data, long udata)
(package private) int
fd(int index)
(package private) short
fflags(int index)
(package private) short
filter(int index)
(package private) short
flags(int index)
(package private) void
free()
Free thisKQueueEventArray
.private static int
getKEventOffset(int index)
private long
getKEventOffsetAddress(int index)
private long
getLong(int index, int offset)
private short
getShort(int index, int offset)
(package private) long
memoryAddress()
Return thememoryAddress
which points to the start of thisKQueueEventArray
.(package private) void
realloc(boolean throwIfFail)
Increase the storage of thisKQueueEventArray
.private void
reallocIfNeeded()
(package private) int
size()
(package private) long
udata(int index)
-
-
-
Field Detail
-
KQUEUE_EVENT_SIZE
private static final int KQUEUE_EVENT_SIZE
-
KQUEUE_IDENT_OFFSET
private static final int KQUEUE_IDENT_OFFSET
-
KQUEUE_FILTER_OFFSET
private static final int KQUEUE_FILTER_OFFSET
-
KQUEUE_FFLAGS_OFFSET
private static final int KQUEUE_FFLAGS_OFFSET
-
KQUEUE_FLAGS_OFFSET
private static final int KQUEUE_FLAGS_OFFSET
-
KQUEUE_DATA_OFFSET
private static final int KQUEUE_DATA_OFFSET
-
KQUEUE_UDATA_OFFSET
private static final int KQUEUE_UDATA_OFFSET
-
memory
private java.nio.ByteBuffer memory
-
memoryAddress
private long memoryAddress
-
size
private int size
-
capacity
private int capacity
-
-
Method Detail
-
memoryAddress
long memoryAddress()
Return thememoryAddress
which points to the start of thisKQueueEventArray
.
-
capacity
int capacity()
Return the capacity of theKQueueEventArray
which represent the maximum number ofkevent
s that can be stored in it.
-
size
int size()
-
clear
void clear()
-
evSet
void evSet(int ident, short filter, short flags, int fflags, long data, long udata)
-
reallocIfNeeded
private void reallocIfNeeded()
-
realloc
void realloc(boolean throwIfFail)
Increase the storage of thisKQueueEventArray
.
-
free
void free()
Free thisKQueueEventArray
. Any usage after calling this method may segfault the JVM!
-
getKEventOffset
private static int getKEventOffset(int index)
-
getKEventOffsetAddress
private long getKEventOffsetAddress(int index)
-
getShort
private short getShort(int index, int offset)
-
flags
short flags(int index)
-
filter
short filter(int index)
-
fflags
short fflags(int index)
-
fd
int fd(int index)
-
data
long data(int index)
-
udata
long udata(int index)
-
getLong
private long getLong(int index, int offset)
-
calculateBufferCapacity
private static int calculateBufferCapacity(int capacity)
-
evSet
private static void evSet(long keventAddress, int ident, short filter, short flags, int fflags, long data, long udata)
-
-