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

Higher parity with std's Vec #95

Open
1 of 6 tasks
pczarn opened this issue Jul 3, 2024 · 5 comments
Open
1 of 6 tasks

Higher parity with std's Vec #95

pczarn opened this issue Jul 3, 2024 · 5 comments

Comments

@pczarn
Copy link
Contributor

pczarn commented Jul 3, 2024

ferrilab's bitvec is probably a drop in replacement for Vec

Roadmap

@pczarn
Copy link
Contributor Author

pczarn commented Jul 4, 2024

we are missing some important stuff such as 'from_raw_parts'

@pczarn
Copy link
Contributor Author

pczarn commented Jul 5, 2024

We cannot implement to/from_raw_parts until #9 is done

@Jujumba
Copy link
Contributor

Jujumba commented Jul 16, 2024

Consider also adding push_within_capacity

@Jujumba
Copy link
Contributor

Jujumba commented Feb 1, 2025

How would interface for from_raw_parts/to_raw_parts look like? I think the following is reasonable:

impl<B: BitBlock> BitVec<B> {
    // `num_of_bits` = nbits
    // `length` = number of Bs behing `ptr`
    fn from_raw_parts(ptr: *mut B, num_of_bits: usize, length: usize, capacity: usize) -> Self;

    fn to_raw_parts(self) -> (*mut B, usize, usize, usize);
}

Though the wording may be a bit confusing (someone may mix up num_of_bits and length).

Also, do we really want to have to_raw_parts instead of into_raw_parts for higher parity?

@pczarn

@Jujumba
Copy link
Contributor

Jujumba commented Feb 2, 2025

How would interface for from_raw_parts/to_raw_parts look like? I think the following is reasonable:

impl<B: BitBlock> BitVec {
// num_of_bits = nbits
// length = number of Bs behing ptr
fn from_raw_parts(ptr: *mut B, num_of_bits: usize, length: usize, capacity: usize) -> Self;

fn to_raw_parts(self) -> (*mut B, usize, usize, usize);

}

Though the wording may be a bit confusing (someone may mix up num_of_bits and length).

Also, do we really want to have to_raw_parts instead of into_raw_parts for higher parity?

@pczarn

I think using num_blocks and num_bits (instead of length and num_of_bits) is less confusing and more concise

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

No branches or pull requests

2 participants