core: Reuse poll fds across calls to handle_events()
authorChris Dickens <christopher.a.dickens@gmail.com>
Thu, 5 Jun 2014 09:04:11 +0000 (02:04 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Wed, 27 Aug 2014 09:41:42 +0000 (02:41 -0700)
commit8c60a6716d7ff3bb4a9e13a9b89ee5622e4fde7f
treeff91419941d0bf2b1feadace23398c95bcac18ad
parentb65dd04a3df1cd7451f0b32f28be3de046ffc62f
core: Reuse poll fds across calls to handle_events()

Prior to this patch, the array of poll fds given to poll() was
allocated and freed every time handle_events() was called. This
is unnecessary if the list of poll fds has not changed since the
last call to handle_events(). With this patch, the array and count
of poll fds is stored in the context and only reallocated when the
list of poll fds changes, saving any unnecessary overhead.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/io.c
libusb/libusbi.h
libusb/version_nano.h