In another part of our code we prefix the buf with a single byte, we then strip it using &buf[1..]. When we do that flatbuffers complains about incorrect byte alignment:
misaligned pointer dereference: address must be a multiple of 0x4 but is 0x14d015401'
If we make a copy of the buf using &buf[1..].to_vec() then it again can be decoded properly. Is there any way to do this without copying the whole buffer?
In rust-flatbuffers I have a buf &[u8] that decodes just fine in flatbuffers (version 1.12):
In another part of our code we prefix the buf with a single byte, we then strip it using
&buf[1..]
. When we do that flatbuffers complains about incorrect byte alignment:misaligned pointer dereference: address must be a multiple of 0x4 but is 0x14d015401'
If we make a copy of the buf using
&buf[1..].to_vec()
then it again can be decoded properly. Is there any way to do this without copying the whole buffer?