5.6.2. Serialization and Deserialization

5.6.2.1. [Major] Samples containing sequences using discontiguous buffers failed to be serialized

Sending a sample containing a sequence that used a discontiguous buffer as the underlying storage for its elements failed with an error similar to this:

RTIXCdrLog_logWithParams:!precondition: sample == ((void *)0)
RTIXCdrInterpreter_fullSerializeSample:MyContainer:m_instance serialization error

[RTI Issue ID CORE-10485]

5.6.2.2. [Major] Calculated maximum size incorrect for unions with nested unions whose members were empty structures

Consider an IDL with a union that has a nested union, and all the nested union members are empty structures, like this:

struct empty {};

union unionWithEmptyStruct switch (int32) {
    case 0:
      empty e;
};

@appendable
union unionWithNestedUnionsWithEmptyStruct switch (int32) {
    case 2:
      unionWithEmptyStruct memberWithEmptyStructure;
};

The method to calculate the maximum serialize sample size returned RTI_CDR_MAX_SERIALIZED_SIZE. Since the maximum serialize size defines the space needed for serialization/deserialization buffers, returning RTI_CDR_MAX_SERIALIZED_SIZE could cause an excessive use of memory.

The calculation of the maximum serialize sample is now correct.

[RTI Issue ID CORE-14760]