1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-10-05 19:18:01 +08:00

Update notifier.cpp

This commit is contained in:
Victor Stewart 2020-05-21 20:04:39 -04:00 committed by GitHub
parent 6f13627882
commit 2e02d0cc30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1374,8 +1374,7 @@ bool UNotifier::waitOnAsynchronousConnects(const UVector<UEventFd *>& waiting, i
struct epoll_event *events;
struct epoll_event *pevents;
size_t maxConnects = waitingOnNConnects + 1;
events = pevents = (struct epoll_event*) UMemoryPool::malloc(maxConnects, sizeof(struct epoll_event), true);
events = pevents = (struct epoll_event*) UMemoryPool::malloc(waiting.size() + 1, sizeof(struct epoll_event), true);
for (UEventFd *waiter : waiting)
{
@ -1411,7 +1410,7 @@ bool UNotifier::waitOnAsynchronousConnects(const UVector<UEventFd *>& waiting, i
}
} while (waitingOnNConnects > 0);
UMemoryPool::_free(events, maxConnects, sizeof(struct epoll_event));
UMemoryPool::_free(events, waiting.size() + 1, sizeof(struct epoll_event));
(void)U_FF_SYSCALL(close, "%d", epollfd);
U_RETURN(result);