Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ksperling-apple committed Jul 30, 2024
1 parent 1503a1e commit fdf665b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/lib/support/Pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ class BitMapObjectPool : public internal::StaticAllocatorBitmap
ChipLogError(Support, "BitMapObjectPool: %lu allocated", static_cast<unsigned long>(Allocated()));
if constexpr (IsDumpable<T>::value)
{
ForEachActiveObjectInner(nullptr, [](void * context, const void * object) {
static_cast<const T *>(object)->DumpToLog();
ForEachActiveObject([](const T * object) {
object->DumpToLog();
return Loop::Continue;
});
}
Expand Down Expand Up @@ -588,8 +588,8 @@ class HeapObjectPool : public internal::Statistics, public HeapObjectPoolExitHan
ChipLogError(Support, "HeapObjectPool: %lu allocated", static_cast<unsigned long>(Allocated()));
if constexpr (IsDumpable<T>::value)
{
mObjects.ForEachNode(nullptr, [](void * context, const void * object) {
static_cast<const T *>(object)->DumpToLog();
ForEachActiveObject([](const T * object) {
object->DumpToLog();
return Loop::Continue;
});
}
Expand Down
7 changes: 3 additions & 4 deletions src/lib/support/logging/TextOnlyLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,11 @@ using LogRedirectCallback_t = void (*)(const char * module, uint8_t category, co
* ChipLogError(Foo, "Delegate=" ChipLogFormatRtti, ChipLogValueRtti(mDelegate));
* @endcode
*/
#if __has_feature(cxx_rtti)
#define ChipLogFormatRtti "%s"
#define ChipLogValueRtti(ptr) ((ptr) != nullptr ? typeid(*(ptr)).name() : "0")
#if __has_feature(cxx_rtti)
#define ChipLogValueRtti(ptr) ((ptr) != nullptr ? typeid(*(ptr)).name() : "null")
#else
#define ChipLogFormatRtti "%c"
#define ChipLogValueRtti(ptr) ((ptr) != nullptr ? '?' : '0')
#define ChipLogValueRtti(ptr) ((ptr) != nullptr ? "?" : "null")
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion src/messaging/tests/TestExchange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ TEST_F(TestExchange, CheckBasicExchangeMessageDispatch)
// {
// MockExchangeDelegate delegate;
// ObjectPool<ExchangeContext, CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS> pool;
// pool.CreateObject(&GetExchangeManager(), static_cast<uint16_t>(1234u), GetSessionAliceToBob(), true, &delegate);
// pool.CreateObject(&GetExchangeManager(), static_cast<uint16_t>(1234), GetSessionAliceToBob(), true, &delegate);
// }

} // namespace

0 comments on commit fdf665b

Please sign in to comment.