Package io.netty.channel.kqueue
Class KQueueEventArray
- java.lang.Object
-
- io.netty.channel.kqueue.KQueueEventArray
-
final class KQueueEventArray extends java.lang.ObjectRepresents 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 intcapacityprivate static intKQUEUE_DATA_OFFSETprivate static intKQUEUE_EVENT_SIZEprivate static intKQUEUE_FFLAGS_OFFSETprivate static intKQUEUE_FILTER_OFFSETprivate static intKQUEUE_FLAGS_OFFSETprivate static intKQUEUE_IDENT_OFFSETprivate static intKQUEUE_UDATA_OFFSETprivate java.nio.ByteBuffermemoryprivate longmemoryAddressprivate intsize
-
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 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) longmemoryAddress()Return thememoryAddresswhich points to the start of thisKQueueEventArray.(package private) voidrealloc(boolean throwIfFail)Increase the storage of thisKQueueEventArray.private voidreallocIfNeeded()(package private) intsize()(package private) longudata(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 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)
-
-