mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 20:53:34 +08:00
GDTR list integrity check (debug builds only)
This commit is contained in:
@@ -95,9 +95,20 @@ GlobalDataTypeRegistry::RegistResult GlobalDataTypeRegistry::registImpl(Entry* d
|
|||||||
p = p->getNextListNode();
|
p = p->getNextListNode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if UAVCAN_DEBUG
|
||||||
|
const unsigned len_before = list->getLength();
|
||||||
|
#endif
|
||||||
list->insertBefore(dtd, EntryInsertionComparator(dtd));
|
list->insertBefore(dtd, EntryInsertionComparator(dtd));
|
||||||
|
|
||||||
#if UAVCAN_DEBUG
|
#if UAVCAN_DEBUG
|
||||||
|
{ // List integrity check
|
||||||
|
const unsigned len_after = list->getLength();
|
||||||
|
if (len_before >= len_after)
|
||||||
|
{
|
||||||
|
assert(0);
|
||||||
|
std::abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
{ // Order check
|
{ // Order check
|
||||||
Entry* p = list->get();
|
Entry* p = list->get();
|
||||||
int id = -1;
|
int id = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user