core: update usbi_dbg to take the context as an argument
authorNathan Hjelm <hjelmn@google.com>
Tue, 20 Jul 2021 15:31:06 +0000 (09:31 -0600)
committerNathan Hjelm <hjelmn@cs.unm.edu>
Wed, 21 Jul 2021 16:03:59 +0000 (10:03 -0600)
commit6cae9c6dbd74c0840848f343dd605c5ddcef1ad1
tree05ab9c50bbafcf66d00f866f99a31126aa2866a3
parentb0fd4d873e224bbb1985971834d31d956080c7a4
core: update usbi_dbg to take the context as an argument

This commit fixes a performance issue caused by the disconnection of the first context
allocated from the default context. usbi_dbg now takes the explicit context instead of
relying on the default context (which may not exist) in most cases. All call sites have
been updated to pass the context or explicitly pass NULL if the context is not
available. We should actively discourage using NULL as the context in the future and
patch all call sites to always pass the context.

Fixes #951

Signed-off-by: Nathan Hjelm <hjelmn@google.com>
21 files changed:
libusb/core.c
libusb/descriptor.c
libusb/hotplug.c
libusb/io.c
libusb/libusbi.h
libusb/os/darwin_usb.c
libusb/os/events_posix.c
libusb/os/events_windows.c
libusb/os/haiku_pollfs.cpp
libusb/os/haiku_usb_backend.cpp
libusb/os/linux_netlink.c
libusb/os/linux_udev.c
libusb/os/linux_usbfs.c
libusb/os/netbsd_usb.c
libusb/os/openbsd_usb.c
libusb/os/sunos_usb.c
libusb/os/windows_common.c
libusb/os/windows_winusb.c
libusb/os/windows_winusb.h
libusb/sync.c
libusb/version_nano.h