HI!
Is there any opportunity, to avoid double allocation of memory using pointer
containers?
I have simple code (below) and I want allocate memory for objects, construct
them, and _move_ (transfer) pointer to the container.
Valgrind shows me that there are made 2 alocations even if I am creating only
1 object.
==20121== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 7 from 1)
==20121== malloc/free: in use at exit: 0 bytes in 0 blocks.
==20121== malloc/free: 2 allocs, 2 frees, 8 bytes allocated.
What is happening If the object is huge? Is there any way to transfer the
pointer?
Regards.
#include