There seems to be an issue when parsing the TRDP config file trdp_config.xml memory block configuration.
The issue is during the sequence of parsing the 'memory-block' tag.
With the memory-block tag the following is expected to be specifed:
In vos_mem.h the following predefined 15 block sizes are defined:
With MD_SUPPORT
#define VOS_MEM_BLOCKSIZES {48u, 72u, 128u, 180u, 256u, 512u, 1024u, 1480u, 2048u, 4096u, 11520u, 16384u, 32768u, 65536u, 131072u}
Without MD_SUPPORT
#define VOS_MEM_BLOCKSIZES {34u, 48u, 128u, 180u, 256u, 512u, 1024u, 1480u, 2048u, 4096u, 11520u, 16384u, 32768u, 65536u, 131072u}
But in tau_xml.c the following predefined list of only 14 blocks are defined:
const UINT32 mem_list[] = {32u, 72u, 128u, 256u, 512u, 1024u, 1480u, 2048u, 4096u, 11520u, 16384u, 32768u, 65536u, 131072u};
Solution :
The mem_list should be based on the macro VOS_MEM_BLOCKSIZES as per vos_mem.h
In tau_xml.c:
const UINT32 mem_list[] = VOS_MEM_BLOCKSIZES;
Another minor Improvement
In the loop which finds a slot to store the preAlloc value for, is not guarded and will become an infinite loop in case the user-given sizeValue is greater than the greatest block size in our memList[].
Proposed solution in attached diff.
You're right, thanks. Just two comments (for further tickets ;-):
• in if-clauses, each boolean expression must be enclosed in parenthesis (MISRA-C rule)
• the ticket owner is the one who is assigned to do the fix – and should be set when accepting the ticket. When having it implemented (checked into the trunk), the ticket should be set to pending; when verified, the ticket can be closed.
This is just to avoid collisions in the SVN trunk...