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

garbage-collection guide: noop read_record #2165

Open
reynir opened this issue Mar 12, 2024 · 0 comments
Open

garbage-collection guide: noop read_record #2165

reynir opened this issue Mar 12, 2024 · 0 comments

Comments

@reynir
Copy link
Contributor

reynir commented Mar 12, 2024

The following read_record function doesn't do anything useful:

let read_record record n fd =
seek_record n fd;
ignore (Unix.read fd (Bytes.of_string record.name) 0 name_size);
ignore (Unix.read fd (Bytes.of_string record.address) 0 addr_size)

The name and addr fields are copied into bytes, and the data is read into those bytes. However, the bytes are just thrown away and does nothing useful. Furthermore, nothing is done to ensure all is read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant