-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: master
Are you sure you want to change the base?
Conversation
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
.
This codex-storage/nim-codex#552 works now. |
No description provided.