mirror of
https://github.com/espressif/openthread.git
synced 2026-08-25 19:59:51 +00:00
[message] simplify method for allocating new message from pool (#7210)
This commit removes different `MessagePool` methods that can be used to allocate a new message and combines them into one `Allocate()` method which uses `Message::Settings`. The `Message::Settings` is also updated to provide new constructor initializing it with a given message priority only.
This commit is contained in:
@@ -93,7 +93,7 @@ void TestSha256(void)
|
||||
VerifyOrQuit(instance != nullptr);
|
||||
|
||||
messagePool = &instance->Get<MessagePool>();
|
||||
VerifyOrQuit((message = messagePool->New(Message::kTypeIp6, 0)) != nullptr);
|
||||
VerifyOrQuit((message = messagePool->Allocate(Message::kTypeIp6)) != nullptr);
|
||||
|
||||
for (const TestCase &testCase : kTestCases)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ void TestHmacSha256(void)
|
||||
VerifyOrQuit(instance != nullptr);
|
||||
|
||||
messagePool = &instance->Get<MessagePool>();
|
||||
VerifyOrQuit((message = messagePool->New(Message::kTypeIp6, 0)) != nullptr);
|
||||
VerifyOrQuit((message = messagePool->Allocate(Message::kTypeIp6)) != nullptr);
|
||||
|
||||
for (const TestCase &testCase : kTestCases)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user