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

fd_t: Refactor and fixes #68

Merged
merged 9 commits into from
Jun 5, 2023
Merged

fd_t: Refactor and fixes #68

merged 9 commits into from
Jun 5, 2023

Conversation

amyspark
Copy link
Collaborator

@amyspark amyspark commented Jun 5, 2023

Hi @dragonmux,

This PR refactors fd_t to greatly reduce duplication, by using the readable_t, writeable_t and seekable_t interfaces you wrote. I also added attributes (nodiscard, inline) where relevant, and fixed the inheritance so that the whole set could interplay appropriately.

I've also taken care of the resize bug that @lethalbit reported.

Fixes #65

@amyspark amyspark requested a review from dragonmux June 5, 2023 01:52
@dragonmux dragonmux added the enhancement New feature or request label Jun 5, 2023
@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Merging #68 (0052d85) into main (606e0cf) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #68      +/-   ##
==========================================
+ Coverage   92.62%   92.68%   +0.06%     
==========================================
  Files          48       47       -1     
  Lines        3390     3172     -218     
  Branches      610      608       -2     
==========================================
- Hits         3140     2940     -200     
+ Misses        193      175      -18     
  Partials       57       57              
Impacted Files Coverage Δ
substrate/advanced/io 100.00% <100.00%> (ø)
substrate/fd 96.00% <100.00%> (-3.21%) ⬇️

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've only reviewed the first half of fd_t so far as there are a lot of changes and we need to cross-reference the advanced IO types, but we figure we'd post the review early so we can discuss while we work on reviewing the rest of fd_t

substrate/advanced/io Outdated Show resolved Hide resolved
substrate/fd Outdated Show resolved Hide resolved
substrate/fd Outdated Show resolved Hide resolved
substrate/fd Outdated Show resolved Hide resolved
substrate/fd Outdated Show resolved Hide resolved
substrate/fd Show resolved Hide resolved
substrate/advanced/io Outdated Show resolved Hide resolved
Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for your excellent work on this! We'll get this merged once we've seen the builds go green.

@dragonmux dragonmux merged commit 0052d85 into main Jun 5, 2023
164 of 165 checks passed
@dragonmux dragonmux deleted the amyspark/fd-t branch June 5, 2023 13:48
@dragonmux dragonmux added the bug Something isn't working label Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fd_t::resize does not update internal size to new size
2 participants