sequence type: use previous field for length if length_name is NULL
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 12 Apr 2021 18:04:36 +0000 (14:04 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 24 Apr 2021 00:13:00 +0000 (20:13 -0400)
A common use-case for sequences is to use the field located immediately
prior to the sequence as sequence length.

The fact that the sequence type needs to explicitly contain its length
name ties the sequence type to where it is placed within the structure
fields, preventing re-use of the sequence type.

In order to reduce the memory footprint of the field descriptions and
allow re-use of common field types, special-case the NULL length_name to
use the field prior to the sequence as length.

This allows more efficient type descriptions without reducing the
overall flexibility of sequence layout.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I5f2ae22ecc4d872d56f9302751990452fc34cb15


No differences found
This page took 0.027065 seconds and 4 git commands to generate.