Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ae78558b authored by David Anekstein's avatar David Anekstein
Browse files

libbinder: Allow vector construction from unaligned data.

std::vector::insert(const_iterator pos, ...) requires that
`pos` be aligned to the size of the type it points to, e.g.
8 byte aligned for an int64_t iterator, to avoid undefined
behavior. In cases where the type is trivially copyable,
it is safe to memcpy the contents of the buffer directly
into the vector. This change does not cover non-trivially-copyable
types that are not aligned to their size within `data`.

Bug: None
Test: run AIDL client / server tests
Change-Id: Ie1a44659e79f7a07cf6c3b318870d0279e1516ce
parent ec0d68e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment