Introduce dynamic compound literal
In C++, compound literal are temporary objects which have a lifetime
bound to its expression. To extend the lifetime of such objects, the
`SIDE_DYNAMIC_COMPOUND_LITERAL' macro is introduced.
In C, this macro expands to `SIDE_COMPOUND_LITERAL'. In C++, it
allocates the necessary size to store the object onto the stack using
`alloca(3)'. The memory is then initialized by copying the expression
to it.
This is necessary for attributes of dynamic fields. However,
`SIDE_DYNAMIC_COMPOUND_LITERAL' only return a pointer to the object and
not its size. To overcome this, the API is changed and the
`side_dynamic_attr_list()' macro must be used on dynamic arguments of
dynamic fields. The macro itself is not defined by libside. Instead,
macro dispatching is done to get the pointer to the object and its size.
Change-Id: Ieddaa6b2209c03031cef916033efd57564229db5
Signed-off-by: Olivier Dion <odion@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.023557 seconds and 4 git commands to generate.