8168500: (se) EPollArrayWrapper optimization for update events should be robust to dynamic changes in file descriptor resource limits
Make eventsHigh final and always initialize it to an empty Map. Reviewed-by: alanb
This commit is contained in:
parent
8d64cef95c
commit
3630a6a4f8
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -118,7 +118,7 @@ class EPollArrayWrapper {
|
|||||||
// file descriptors higher than MAX_UPDATE_ARRAY_SIZE (unlimited case at
|
// file descriptors higher than MAX_UPDATE_ARRAY_SIZE (unlimited case at
|
||||||
// least) then the update is stored in a map.
|
// least) then the update is stored in a map.
|
||||||
private final byte[] eventsLow = new byte[MAX_UPDATE_ARRAY_SIZE];
|
private final byte[] eventsLow = new byte[MAX_UPDATE_ARRAY_SIZE];
|
||||||
private Map<Integer,Byte> eventsHigh;
|
private final Map<Integer,Byte> eventsHigh = new HashMap<>();
|
||||||
|
|
||||||
// Used by release and updateRegistrations to track whether a file
|
// Used by release and updateRegistrations to track whether a file
|
||||||
// descriptor is registered with epoll.
|
// descriptor is registered with epoll.
|
||||||
@ -133,10 +133,6 @@ class EPollArrayWrapper {
|
|||||||
int allocationSize = NUM_EPOLLEVENTS * SIZE_EPOLLEVENT;
|
int allocationSize = NUM_EPOLLEVENTS * SIZE_EPOLLEVENT;
|
||||||
pollArray = new AllocatedNativeObject(allocationSize, true);
|
pollArray = new AllocatedNativeObject(allocationSize, true);
|
||||||
pollArrayAddress = pollArray.address();
|
pollArrayAddress = pollArray.address();
|
||||||
|
|
||||||
// eventHigh needed when using file descriptors > 64k
|
|
||||||
if (OPEN_MAX > MAX_UPDATE_ARRAY_SIZE)
|
|
||||||
eventsHigh = new HashMap<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void initInterrupt(int fd0, int fd1) {
|
void initInterrupt(int fd0, int fd1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user