Enderal SE
https://mod.pub/enderal-se/38-enderal-se
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
695 B
43 lines
695 B
#include "IMemPool.h"
|
|
|
|
void Test_IMemPool(void)
|
|
{
|
|
IMemPool <UInt32, 3> pool;
|
|
|
|
_DMESSAGE("main: pool test");
|
|
gLog.Indent();
|
|
|
|
_DMESSAGE("start");
|
|
pool.Dump();
|
|
|
|
UInt32 * data0, * data1, * data2;
|
|
|
|
data0 = pool.Allocate();
|
|
_DMESSAGE("alloc0 = %08X", data0);
|
|
pool.Dump();
|
|
|
|
data1 = pool.Allocate();
|
|
_DMESSAGE("alloc1 = %08X", data1);
|
|
pool.Dump();
|
|
|
|
data2 = pool.Allocate();
|
|
_DMESSAGE("alloc2 = %08X", data2);
|
|
pool.Dump();
|
|
|
|
_DMESSAGE("free0 %08X", data0);
|
|
pool.Free(data0);
|
|
pool.Dump();
|
|
|
|
data0 = pool.Allocate();
|
|
_DMESSAGE("alloc0 = %08X", data0);
|
|
pool.Dump();
|
|
|
|
_DMESSAGE("free2 %08X", data2);
|
|
pool.Free(data2);
|
|
pool.Dump();
|
|
|
|
_DMESSAGE("done");
|
|
pool.Dump();
|
|
|
|
gLog.Outdent();
|
|
}
|
|
|