-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Some actual proper design for internals #15
Comments
Is there a reason why it needs to be (pointer, len, cap) and not (pointer, cap, len) for Lean? Is it related to performance? |
No, the |
Yeah, regarding the current design, I was asking why capacity were put into the higher 32 bits of length rather than length were put into the higher 32 bits of capacity? Isn't capacity being used more since it also stores the tag when capacity is 0? |
No, capacity is only used:
Most of what you want to do with a |
Messing around between the fat pointer and thin pointer is quite a lot of work, and there is quite some deep coupling between
generic::Cow
, theBeef
trait and theCapacity
.Capacity
is also a poor name for what the trait is doing now.A reasonable logical split would be:
generic::Cow
implements the API surface, methods likeborrow
,owned
andinto_owned
, as well as all the traits one expects.Beef
converts borrowed and owned values into parts (pointer, len, cap) and back.Capacity
to something likeContainer
, have it store (pointer, len, cap) fromBeef
internally so that the particulars of how capacity is handled doesn't leak out to other abstractions.The text was updated successfully, but these errors were encountered: