- edited description
Bug in memory program
Issue #153
resolved
There is a bug in memory program. This:
while(errorCode == oC_ErrorCode_OutputArrayToSmall)
{
stats = smartalloc(sizeof(oC_MemMan_AllocatorsStats_t) * size , AllocationFlags_ZeroFill);
if(stats != NULL)
{
errorCode = oC_MemMan_ReadAllocatorsStats(stats,&size);
if(errorCode == oC_ErrorCode_OutputArrayToSmall)
{
smartfree(stats,sizeof(oC_MemMan_AllocatorsStats_t) * size ,AllocationFlags_Default);
size *= 2;
}
}
else
{
errorCode = oC_ErrorCode_AllocationError;
}
}
Should be:
while(errorCode == oC_ErrorCode_OutputArrayToSmall)
{
uint32_t tempSize = size;
stats = smartalloc(sizeof(oC_MemMan_AllocatorsStats_t) * size, AllocationFlags_ZeroFill);
if(stats != NULL)
{
errorCode = oC_MemMan_ReadAllocatorsStats(stats,&tempSize);
if(errorCode == oC_ErrorCode_OutputArrayToSmall)
{
smartfree(stats,sizeof(oC_MemMan_AllocatorsStats_t) * size ,AllocationFlags_Default);
size *= 2;
}
}
else
{
errorCode = oC_ErrorCode_AllocationError;
}
}
Comments (3)
-
reporter -
reporter - changed status to resolved
fixed
-
reporter - removed component
Removing component: core-space program (automated comment)
- Log in to comment