Loading src/TNL/Containers/Array_impl.h +10 −5 Original line number Diff line number Diff line Loading @@ -175,12 +175,17 @@ setSize( const Index size ) if( this->size == size && allocationPointer && ! referenceCounter ) return; this->releaseData(); // Allocating zero bytes is useless. Moreover, the allocators don't behave the same way: // "operator new" returns some non-zero address, the latter returns a null pointer. if( size > 0 ) { Algorithms::ArrayOperations< Device >::allocateMemory( this->allocationPointer, size ); this->data = this->allocationPointer; this->size = size; TNL_ASSERT( this->allocationPointer, std::cerr << "This should never happen - allocator did not throw on an error." << std::endl; ); } } template< typename Element, typename Device, Loading Loading
src/TNL/Containers/Array_impl.h +10 −5 Original line number Diff line number Diff line Loading @@ -175,12 +175,17 @@ setSize( const Index size ) if( this->size == size && allocationPointer && ! referenceCounter ) return; this->releaseData(); // Allocating zero bytes is useless. Moreover, the allocators don't behave the same way: // "operator new" returns some non-zero address, the latter returns a null pointer. if( size > 0 ) { Algorithms::ArrayOperations< Device >::allocateMemory( this->allocationPointer, size ); this->data = this->allocationPointer; this->size = size; TNL_ASSERT( this->allocationPointer, std::cerr << "This should never happen - allocator did not throw on an error." << std::endl; ); } } template< typename Element, typename Device, Loading