This is an informational message about an upcoming LLCPP migration.
It is optional to read - all migration work will be performed by the FIDL team.
There are upcoming changes to the way that union and table fields are represented in-memory in LLCPP to match recent changes to the underlying wire format. This means the following changes will be made to the LLCPP API:
Changes to Table API
Fields will be assigned in one of two different ways depending on the size of the content.
Setting fields > 4 bytes in size: (currently used for all values regardless of size)
T& set_my_field(::fidl::ObjectView<uint64_t> elem);
Setting fields <= 4 bytes in size:
T& set_my_field(uint32_t value);
Changes to Union API
Resource unions will be move-only. Non-resource unions can still be moved or copied.
Fields will be assigned in one of two different ways depending on the size of the content.
Setting fields > 4 bytes in size: (currently used for all values regardless of size)
void set_my_field(::fidl::ObjectView<uint64_t> val);
Setting fields <= 4 bytes in size:
void set_my_field(uint32_t val);
Motivation
RFC-0114 proposed a wire format change that introduces a mechanism to inline value <= 4 bytes in size into envelopes, the structure used to store FIDL union and table fields. LLCPP uses an in-memory representation closely matching the FIDL wire format and is designed for efficient access to these structures. The new assignment API allows efficient access to inlined fields and the ability to avoid an allocation that otherwise would be needed.