core: Optimize the memory layout of the transfer structure
Prior to this commit, the memory layout of the transfer structure was as
follows:
------------------------------------------------------
| usbi_transfer | libusb_transfer [variable] | os_priv |
------------------------------------------------------
With this layout, accessing the os_priv area requires calculating the
size of the area used by the libusb_transfer, which varies based on the
number of iso packets allocated for the transfer.
This commit changes the memory layout of the transfer structure to the
following:
------------------------------------------------------
| os_priv | usbi_transfer | libusb_transfer [variable] |
------------------------------------------------------
Having the os_priv in a fixed position relative to the usbi_transfer
allows for constant-time access with the added benefit of not allowing
the user to corrupt the data by accessing elements of the
libusb_transfer structure that are out-of-bounds.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>