Is there a way to get a Vec<u8> with an alignment (known at compile time) greater than 1? Preferably, where all subsequent uses of the Vec<u8>, including pushing and drop, are safe and correct. #rustlang (I *think* the answer is no, but it would simplify a problem I have.)
That's what I was getting at here: https://twitter.com/burntsushi5/status/1254599245480579072 … --- The problem is that you have to write the wrapper with some gnarly unsafe internals that I'm likely to get wrong. But if there's a simpler solution, I'm all ears. :-)
-
-
Allocing a buffer of bytes, that can't be hard :) Only problem is if you want to have the Vec methods. Slice methods we can suppy anywhere. I was thinking that an aligned slice is possible in safe code, of course, so depends on what's needed.https://gist.github.com/7851e7a679b91cd00d5f91816e9092f1 …
-
Yeah, I need vec methods like push. That might work though. Thanks!
End of conversation
New conversation -
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.