Can someone explain to me how `Box::from_raw` and `Box::into_raw` are able to work with unsized types? Aren't we 100% for sure loosing the size/vtable? /cc @Gankro
-
-
-
Replying to @Gankra_
So you're saying `mem::size_of::<*const [u8]>` is double width, right? Shouldn't the compiler be disallowing a cast from a fat raw pointer to a thin raw pointer? If `Box::<[u8]>::into_raw` goes through C, that will cause big problems right?
2 replies 0 retweets 0 likes -
Replying to @sgrif
Well, *const [u8] is not a type you should even pass to C, but yeah all pointers to unsized types become fat, even raw pointers
1 reply 0 retweets 0 likes
Context: I'm noticing that we're forcing SQLite to copy some buffers that it shouldn't need to, but its destructor function only passes the pointer back not the length. Currently wishing Vec and Box<[]> worked more like Rc in this regard
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.