Skip to content

Commit

Permalink
[qpg6100] Move extern alloc to ThreadStackManagerImpl (#6990)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-s-wrk authored and pull[bot] committed Jun 21, 2021
1 parent 0c27472 commit 3dc3700
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/platform/qpg6100/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,4 @@ extern "C" void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const ch
chip::DeviceLayer::OnLogOutput();
}

// TODO: have qpg6100 openthread platform implementation defines the APIs.
// It is not perfect to have the openthread platform calloc/free
// APIs defined here. If a dedicated source file (e.g. Memory.cpp)
// that includes only the two functions is used, the target file
// Memory.o will be thrown away whening linking the libary because
// there is no one referring the symbols (We are not linking
// the 'platform' library against openthread).
extern "C" void * otPlatCAlloc(size_t aNum, size_t aSize)
{
return CHIPPlatformMemoryCalloc(aNum, aSize);
}

extern "C" void otPlatFree(void * aPtr)
{
CHIPPlatformMemoryFree(aPtr);
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD
10 changes: 10 additions & 0 deletions src/platform/qpg6100/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,13 @@ extern "C" void otSysEventSignalPending(void)
BaseType_t yieldRequired = ThreadStackMgrImpl().SignalThreadActivityPendingFromISR();
portYIELD_FROM_ISR(yieldRequired);
}

extern "C" void * otPlatCAlloc(size_t aNum, size_t aSize)
{
return CHIPPlatformMemoryCalloc(aNum, aSize);
}

extern "C" void otPlatFree(void * aPtr)
{
CHIPPlatformMemoryFree(aPtr);
}

0 comments on commit 3dc3700

Please sign in to comment.