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

Commit 0c19d12a authored by Jack He's avatar Jack He
Browse files

GD-Packet: Do not assume POD type for fixed size custom type

* Instead of assuming POD type, define a data() and length() interface
  for fixed size custom types and use the returned value for value
  serialization and deserialization
* This allows custom fixed types to implement other base classes as
  any virtual function will make the object not POD due to the creation
  VTABLE pointer for the virtual function
* Moreover, treating objects as POD types and write to its memory
  without protection is generally dangerous as it is subjected to
  padding and alignment decisions of the compiler and processor
* Also, use std::array in hci::Address and hci::ClassOfDevice to
  discourage writing to raw C arrays directly

Bug: 157533831
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I81e17fd03ab58b42a195ef566bb1aa453f85684a
parent 56390564
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