-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
breaking-changeIs or requires a semver-breaking API changeIs or requires a semver-breaking API change
Description
We could consider adding a TransferError variant for when the transfer fails due to out-of-memory. This is a breaking change because it's not #[non_exhaustive]. However, TransferError is supposed to be cross-platform, but the way memory limits work differs between operating systems:
- Linux has a global memory limit
/sys/module/usbcore/parameters/usbfs_memory_mbfor allocated zero-copy buffers as well as in-flight transfers backed by regular memory. When exceeded when submitting a transfer, we currently returnTransferError::Unknown(12)(ENOMEM). - Windows: has a per-transfer limit that is normally 2MB. When exceeded, it fails with
TransferError::Unknown(1)(ERROR_INVALID_FUNCTION) and the underlying NTSTATUS isSTATUS_INVALID_DEVICE_REQUEST. Not sure if other invalid parameters can fail with the same error. - macOS: ???
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking-changeIs or requires a semver-breaking API changeIs or requires a semver-breaking API change