maciejhirsz / beef

Faster, more compact implementation of std::borrow::Cow
https://crates.io/crates/beef
Apache License 2.0
338 stars 17 forks source link

0.3.1 #13

Closed maciejhirsz closed 4 years ago

maciejhirsz commented 4 years ago
maciejhirsz commented 4 years ago

Why use unsafe code here? This should be the same as just doing let old = cow; above, and drop(old) here (and you can even leave away the latter).

No good reason, I was messing around trying to make it drop when I fixed one of the two issues.

Miri is now tossing out this: Memory access failed: pointer must be in-bounds at offset 77309411346, but is outside bounds of allocation 30796 which has size 18 when accessing (*ptr).len(). This is actually correct now (18 length, 18 capacity, 77309411346 == 18 | 18 (<< 32)), is there a way to silence Miri only in a specific line?

Edit: I guess what I really need is a way to read the length from a raw fat pointer, without touching the actual pointer part of it.

maciejhirsz commented 4 years ago

Closing in favor of #14.