Package io.netty.channel.kqueue
Class KQueueEventArray
java.lang.Object
io.netty.channel.kqueue.KQueueEventArray
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
FieldsModifier and TypeFieldDescriptionprivate intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate ByteBufferprivate longprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intcalculateBufferCapacity(int capacity) (package private) intcapacity()Return the capacity of theKQueueEventArraywhich represent the maximum number ofkevents that can be stored in it.(package private) voidclear()(package private) longdata(int index) (package private) voidevSet(int ident, short filter, short flags, int fflags, long data, long udata) private static voidevSet(long keventAddress, int ident, short filter, short flags, int fflags, long data, long udata) (package private) intfd(int index) (package private) shortfflags(int index) (package private) shortfilter(int index) (package private) shortflags(int index) (package private) voidfree()Free thisKQueueEventArray.private static intgetKEventOffset(int index) private longgetKEventOffsetAddress(int index) private longgetLong(int index, int offset) private shortgetShort(int index, int offset) (package private) longReturn thememoryAddresswhich points to the start of thisKQueueEventArray.(package private) voidrealloc(boolean throwIfFail) Increase the storage of thisKQueueEventArray.private void(package private) intsize()(package private) longudata(int index)
-
Field Details
-
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
-
memoryAddress
private long memoryAddress -
size
private int size -
capacity
private int capacity
-
-
Constructor Details
-
KQueueEventArray
KQueueEventArray(int capacity)
-
-
Method Details
-
memoryAddress
long memoryAddress()Return thememoryAddresswhich points to the start of thisKQueueEventArray. -
capacity
int capacity()Return the capacity of theKQueueEventArraywhich represent the maximum number ofkevents 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)
-