Thanks Michael,
I hadn't considered there would be an essay in the commit, thanks for that - though it doesn't shed a lot of light on the situation
There seems to be 2 places that mark a Name using the high bit, and only one place that kinda-sorta reads it.
The Name is 'marked' during populate() which seems to be to mark each name with a '*' and the high-bit, before going through and getting the current names for the processes - adding new ones and replacing the old ones without '*' and high-bit mark. So items which are double marked are effectively stale/historic.
It is also 'marked' during the find call .. which basically marks the 'found' name if it was not found and then constructed. The does not appear to be any purpose to this that I can ascertain.
The one place (afaict) it reads the value is in zero() below - the problem is that it looks at the entire top uint32 rather than just that high byte!! It's hard to work out whether this is just a long-standing bug or whether it is weeding out names > 12 characters as well from being removed.
So this seems to remove an item from the map, but only if it isn't marked (or long) ie if it isn't stale - or been 'seen' I guess?
bool zero(TaskHandle_t taskid)
{
for (int i = 0; i < count; ++i)
{
if (map[i].id == taskid)
{
if (map[i].name.words[NAMELEN/4-1] > 0)
return false;
for (++i ; i < count; ++i)
{
map[i-1] = map[i];
}
--count;
return true;
}
}
return false;
}
Does this help? Any thoughts on what this was meant to do ? I've CCd Stephen with a hope he might chip in?
//.