blob: 6a80cb337f9033b8cab2a05f40d96e8596c06d62 [file] [log] [blame] [view]
## fi-0093: Max ordinal in table must be table {:#fi-0093}
The type of the 64th member in a FIDL table must itself be a table:
{% include "docs/reference/fidl/language/error-catalog/label/_bad.md" %}
```fidl
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0093.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
Users that find themselves needing to add a 64th member should create a separate
table to hold members 64 and beyond, and place that member in the table instead:
{% include "docs/reference/fidl/language/error-catalog/label/_good.md" %}
```fidl
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0093.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
The reasoning and motivations behind this requirement are fully elaborated in
[RFC-0132: FIDL table size limit][rfc-0132]. In short, FIDL tables need to have
relatively constrained limits on the number of fields that they allow, otherwise
the encoded form of a table that only uses a few fields at a time would have an
unacceptably large amount of dead space (16 bytes for every omitted member).
To give users who want more than 64 fields in their tables a workaround, FIDL
forces the last ordinal to be reserved for a "continuation table" that contains
the extra fields. Using any other type in this position would render the table
unextendable going forward.
[rfc-0132]: /docs/contribute/governance/rfcs/0132_fidl_table_size_limit.md