Extern :
- C3d aggiornamento delle librerie.
This commit is contained in:
@@ -20,10 +20,6 @@
|
||||
#include <tool_err_handling.h>
|
||||
|
||||
|
||||
#ifdef __DEBUG_MEMORY_ALLOCATE_FREE_
|
||||
#include <typeinfo.h>
|
||||
#endif // __DEBUG_MEMORY_ALLOCATE_FREE_
|
||||
|
||||
|
||||
FORVARD_DECL_TEMPLATE_TYPENAME( class CcArray );
|
||||
FORVARD_DECL_TEMPLATE_TYPENAME( void fill_array( CcArray<Type> &, const Type & fillData, size_t cnt ) );
|
||||
@@ -68,12 +64,7 @@ public :
|
||||
/// \ru Освободить память. \en Free memory.
|
||||
void FreeMemory() { SetArraySize( 0 ); }
|
||||
/// \ru Оператор доступа. \en An access operator.
|
||||
Type & operator []( size_t idx ) const {
|
||||
#if defined(C3D_DEBUG)
|
||||
PRECONDITION( idx < count );
|
||||
#endif
|
||||
return parr[idx];
|
||||
}
|
||||
Type & operator []( size_t idx ) const { PRECONDITION( idx < count ); return parr[idx]; }
|
||||
/// \ru Выделена ли память? \en Is memory allocated?
|
||||
bool IsNull () const { return parr == NULL; }
|
||||
/// \ru Выдать адрес начала массива. \en Get address of the beginning of an array.
|
||||
@@ -134,9 +125,7 @@ inline CcArray<Type>::CcArray( size_t _count )
|
||||
template <class Type>
|
||||
inline void CcArray<Type>::Copy( const void * from, size_t cnt, size_t offset )
|
||||
{
|
||||
#if defined(C3D_DEBUG)
|
||||
PRECONDITION( (offset + cnt <= count) && (cnt ? from != NULL : true) );
|
||||
#endif
|
||||
memcpy( parr + offset, from, cnt * sizeof(Type) );
|
||||
}
|
||||
|
||||
@@ -172,7 +161,7 @@ inline bool CcArray<Type>::SetArraySize( size_t newCount )
|
||||
#if defined(C3D_DEBUG)
|
||||
count = newCount;
|
||||
#ifdef __REALLOC_ARRAYS_STATISTIC_
|
||||
::ReallocArrayStatistic( oldParr, oldSize * sizeof(Type), parr, newCount * sizeof(Type), 4/*CcArray*/ );
|
||||
REALLOC_ARRAY_STATISTICS( oldParr, oldSize * sizeof(Type), parr, newCount * sizeof(Type), 4/*CcArray*/ );
|
||||
#endif // __REALLOC_ARRAYS_STATISTIC_
|
||||
#endif // C3D_DEBUG
|
||||
}
|
||||
@@ -202,9 +191,7 @@ inline bool CcArray<Type>::SetArraySize( size_t newCount )
|
||||
template <class Type>
|
||||
void fill_array( CcArray<Type> & arr, const Type & fillData, size_t cnt )
|
||||
{
|
||||
#if defined(C3D_DEBUG)
|
||||
PRECONDITION( cnt <= arr.count );
|
||||
#endif
|
||||
for ( size_t i = 0; i < cnt; i++ )
|
||||
memcpy( &arr[i], &fillData, sizeof(Type) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user