mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Initial design
This commit is contained in:
parent
f3ace52884
commit
120d9b4eba
@ -126,6 +126,10 @@ namespace etl
|
||||
{
|
||||
::new(p) TMessage();
|
||||
}
|
||||
else
|
||||
{
|
||||
ETL_ALWAYS_ASSERT(ETL_ERROR(etl::message_pool_allocation_failure));
|
||||
}
|
||||
}
|
||||
|
||||
return reinterpret_cast<TMessage*>(p);
|
||||
@ -149,6 +153,10 @@ namespace etl
|
||||
{
|
||||
::new(p) TMessage(t1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ETL_ALWAYS_ASSERT(ETL_ERROR(etl::message_pool_allocation_failure));
|
||||
}
|
||||
}
|
||||
|
||||
return reinterpret_cast<TMessage*>(p);
|
||||
@ -172,6 +180,10 @@ namespace etl
|
||||
{
|
||||
::new(p) TMessage(t1, t2);
|
||||
}
|
||||
else
|
||||
{
|
||||
ETL_ALWAYS_ASSERT(ETL_ERROR(etl::message_pool_allocation_failure));
|
||||
}
|
||||
}
|
||||
|
||||
return reinterpret_cast<TMessage*>(p);
|
||||
@ -195,6 +207,10 @@ namespace etl
|
||||
{
|
||||
::new(p) TMessage(t1, t2, t3);
|
||||
}
|
||||
else
|
||||
{
|
||||
ETL_ALWAYS_ASSERT(ETL_ERROR(etl::message_pool_allocation_failure));
|
||||
}
|
||||
}
|
||||
|
||||
return reinterpret_cast<TMessage*>(p);
|
||||
@ -218,6 +234,10 @@ namespace etl
|
||||
{
|
||||
::new(p) TMessage(t1, t2, t3, t4);
|
||||
}
|
||||
else
|
||||
{
|
||||
ETL_ALWAYS_ASSERT(ETL_ERROR(etl::message_pool_allocation_failure));
|
||||
}
|
||||
}
|
||||
|
||||
return reinterpret_cast<TMessage*>(p)
|
||||
@ -229,8 +249,11 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void destroy(const etl::imessage* const pmsg)
|
||||
{
|
||||
pmsg->~imessage();
|
||||
memory_block_pool.release_memory_block(pmsg);
|
||||
if (pmsg != ETL_NULLPTR)
|
||||
{
|
||||
pmsg->~imessage();
|
||||
memory_block_pool.release_memory_block(pmsg);
|
||||
}
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user