The appropriate mapping for the native struct
struct Parameters_VE3_RSG_v19b_Protect_ {
real_T Constant_Value;
boolean_T Memory_X0;
boolean_T Logic_table[16];
};
would be
public class Parameters_VE3_RSG_v19b_Protect extends Structure {
public double Constant_Value;
public byte Memory_X0;
public byte[] Logic_table = new byte[16];
}
You are implying that instead your native struct is defined as the following:
struct Parameters_VE3_RSG_v19b_Protect_ {
real_T Constant_Value;
boolean_T Memory_X0;
boolean_T* Logic_table;
};
This represents a distinctly different memory layout than what you pose in your question, namely:
with array with pointer
+----------------+ +----------------+
Constant_Value | 0x0000-0x0007 | | 0x0000-0x0007 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
+----------------+ +----------------+
Memory_X0 | 0x0008 | | 0x0008 |
+----------------+ +----------------+
Logic_table | 0x0009-0x0018 | | 3 or 7 bytes |
(array) | | | padding |
| | | |
| | +----------------+
| | | 0x000C-0x000F | logic_table (pointer)
| | | or |
| | | 0x0010-0x0018 |
| | | |
| | +----------------+
| |
| |
| |
| |
| |
| |
| |
| |
+----------------+
The difference in length on the right hand side is whether your pointers are 32- or 64-bit in size. The left side may or may not have padding preceding the byte array, depending on your compiler and settings.
What does sizeof(Parameters_VE3_RSG_v19b_Protect_)
return?