Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spdm_transport: generic: refactor IO buffers #120

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

twilfredo
Copy link
Collaborator

@twilfredo twilfredo commented Oct 31, 2024

This allows us to remove alot of repeated code for buffer set/get. This approach uses a heap allocated vector and just passes a reference to libspdm when required.

The associated memory shall be explicitly freed
by taking ownership when the buffers are no longer required. Which can be done by calling libspdm_drop_io_buffers().

@twilfredo twilfredo requested a review from alistair23 October 31, 2024 05:19
@twilfredo twilfredo force-pushed the wilfred/refactor_io_buffers branch from d7cf66f to 8fe1a25 Compare October 31, 2024 05:21
@twilfredo
Copy link
Collaborator Author

to go in after #119

@twilfredo twilfredo force-pushed the wilfred/refactor_io_buffers branch from 8fe1a25 to 44b76c7 Compare October 31, 2024 05:23
Base automatically changed from wilfred/make-ruby-deps-optional to wilfred/bump-libspdm-3.5.0 November 8, 2024 00:08
src/usb_i2c.rs Show resolved Hide resolved
src/io_buffers.rs Outdated Show resolved Hide resolved
Base automatically changed from wilfred/bump-libspdm-3.5.0 to master November 8, 2024 00:20
This allows us to remove alot of repeated code for buffer `set/get`. This
approach uses a heap allocated vector and just passes a reference to
`libspdm` when required.

The associated memory shall be explicitly freed
by taking ownership when the buffers are no longer required. Which can be
done by calling `libspdm_drop_io_buffers()`.

Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
@twilfredo twilfredo force-pushed the wilfred/refactor_io_buffers branch from 44b76c7 to 05a7aed Compare November 8, 2024 00:44
@twilfredo twilfredo requested a review from alistair23 November 8, 2024 00:45
@alistair23 alistair23 merged commit 5baa345 into master Nov 8, 2024
2 checks passed
@alistair23 alistair23 deleted the wilfred/refactor_io_buffers branch November 8, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants