When using MQX 3.8 to create a partition with _partition_create_at, a few issues appear to be present:
- The number of blocks within the partition is incorrect. There appears to be no way for the user to determine dynamically the number of bytes to allocate for the function to guarantee a certain number of blocks are available.
- The alignment of the blocks within a partition is lost due to additions by MQX.
Both of the issues appear to be the result of the following:
- The initial alignment of the partition (should be documented as required to not waste memory)
- The PARTPOOL_STRUCT assigned to the beginning of the partition stealing from memory for blocks (the user has no method of determine the size of the structure to add it to the initial declaration of memory in the application)
- The INTERNAL_PARTITION_BLOCK_STRUCT appears to be added to beginning of every block within the partition (again, the size is not available)
- The alignment of the blocks within the partition due to adding a structure at the beginning of each block
Here are a couple questions that the documentation doesn't clarify:
- If 10 blocks of 256 bytes are required, how does the user make the memory declaration?
- Can the user aligned each block on a 256 byte boundary by aligning the declaration on a 256 byte boundary?
The only example I could find within MQX was in mqx\examples\benchmrk\timing\test.c which uses magic numbers when calling the function.