Skip to content

Threaded IO datastore with minimal modifications #48

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

Draft
wants to merge 173 commits into
base: master
Choose a base branch
from

Conversation

dryajov
Copy link
Contributor

@dryajov dryajov commented Sep 15, 2023

No description provided.

@dryajov
Copy link
Contributor Author

dryajov commented Sep 15, 2023

Added some tests and a very ugly locking mechanism that we can hopefully refine. The good thing is that all tests pass and there are 0 changes to the api.

@elcritch
Copy link
Contributor

Added some tests and a very ugly locking mechanism that we can hopefully refine. The good thing is that all tests pass and there are 0 changes to the api.

Ok, nice.


converter toSeq*(self: DataBuffer): seq[byte] =
## convert buffer to a seq type using copy and either a byte or char
##

result = newSeq[byte](self.len)
if self.len() > 0:
copyMem(addr result[0], unsafeAddr self[].buf[0], self.len)
copyMem(addr result[0], addr self[].buf[0], self.len)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah good! I was thinking about that this weekend.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, but maybe this should also be switched to baseAddr? Not sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or the other way around, switch baseAddr to addr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Imo, addr is probably safer, baseAddr does a straight up cast.

@dryajov
Copy link
Contributor Author

dryajov commented Sep 20, 2023

This codex-storage/nim-codex#552 works now.

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