object_pool-snippet.h 323 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
embb::containers::ObjectPool<int> objPool(5); //@\label{lst:object_pool_lst1:line_create}@

int* alloc[5];

for (int i = 0; i != 5; ++i) {
  alloc[i] = objPool.Allocate(); //@\label{lst:object_pool_lst1:line_allocate}@
}

for (int i = 0; i != 5; ++i) {
  objPool.Free(alloc[i]); //@\label{lst:object_pool_lst1:line_free}@
}