[mbedtls] move heap into otInstance. (#1996)

This commit is contained in:
Buke Po
2017-07-14 08:37:12 -07:00
committed by Jonathan Hui
parent 4a1bbc8044
commit d4836a4426
5 changed files with 30 additions and 16 deletions
+2 -2
View File
@@ -93,7 +93,7 @@ void TestAllocateRandomly(size_t aSizeLimit, unsigned int aSeed)
do
{
size_t size = sizeof(Node) + rand() % aSizeLimit;
size_t size = sizeof(Node) + static_cast<size_t>(rand()) % aSizeLimit;
Log("TestAllocateRandomly allocating %zu bytes...", size);
last->mNext = static_cast<Node *>(heap.CAlloc(1, size));
@@ -109,7 +109,7 @@ void TestAllocateRandomly(size_t aSizeLimit, unsigned int aSeed)
++nnodes;
// 50% probability to randomly free a node.
size_t freeIndex = rand() % (nnodes * 2);
size_t freeIndex = static_cast<size_t>(rand()) % (nnodes * 2);
if (freeIndex > nnodes)
{