Класс для работы с памятью. Подробнее...
#include <utilities/allocator.h>
Открытые члены | |
template<class type > | |
type * | AllocateBlock (void) |
template<class type > | |
type * | AllocateArray (const std::size_t &ArrayLength) |
template<class type > | |
void | DeallocateBlock (type *Block) |
template<class type > | |
void | DeallocateArray (type *Array) |
Класс для работы с памятью.
См. определение в файле allocator.h строка 49
type * nitro::Allocator::AllocateArray | ( | const std::size_t & | ArrayLength | ) |
Функция выделения памяти под массив.
ArrayLength | - длина массива. |
nitro::exception | Кидает исключение с описанием ошибки. |
См. определение в файле allocator.h строка 153
Перекрестные ссылки nitro::exception::code() и nitro::exception::what().
{ try { return( new type[ ArrayLength ] ); } catch( nitro::exception e ) { throw( nitro::exception( std::string( "Allocator::AllocateArray( std::size_t ArrayLength )::" ) + e.what() , e.code() ) ); } catch( ... ) { throw( nitro::exception( std::string( "Allocator::AllocateArray( std::size_t ArrayLength )::An error occured" ) , 1 ) ); } }
type * nitro::Allocator::AllocateBlock | ( | void | ) |
Функция выделения блока памяти.
nitro::exception | Кидает исключение с описанием ошибки. |
См. определение в файле allocator.h строка 137
Перекрестные ссылки nitro::exception::code() и nitro::exception::what().
Используется в nitro::SharedPointer< managed_type >::SharedPointer().
{ try { return( new type() ); } catch( nitro::exception e ) { throw( nitro::exception( std::string( "Allocator::AllocateBlock( void )::" ) + e.what() , e.code() ) ); } catch( ... ) { throw( nitro::exception( std::string( "Allocator::AllocateBlock( void )::An error occured" ) , 1 ) ); } }
void nitro::Allocator::DeallocateArray | ( | type * | Array | ) |
Функция особождения памяти из под массива.
Array | - Указатель на выделенный массив. |
nitro::exception | Кидает исключение с описанием ошибки. |
См. определение в файле allocator.h строка 185
Перекрестные ссылки nitro::exception::code() и nitro::exception::what().
{ try { delete [] Array; } catch( nitro::exception e ) { throw( nitro::exception( std::string( "Allocator::DeallocateArray( type * Array )::" ) + e.what() , e.code() ) ); } catch( ... ) { throw( nitro::exception( std::string( "Allocator::DeallocateArray( type * Array )::An error occured" ) , 1 ) ); } }
void nitro::Allocator::DeallocateBlock | ( | type * | Block | ) |
Функция освобождения блока памяти.
Block | - Указатель на выделенный блок памяти. |
nitro::exception | Кидает исключение с описанием ошибки. |
См. определение в файле allocator.h строка 169
Перекрестные ссылки nitro::exception::code() и nitro::exception::what().
Используется в nitro::SharedPointer< managed_type >::Release().
{ try { delete Block; } catch( nitro::exception e ) { throw( nitro::exception( std::string( "Allocator::DeallocateBlock( type * Block )::" ) + e.what() , e.code() ) ); } catch( ... ) { throw( nitro::exception( std::string( "Allocator::DeallocateBlock( type * Block )::An error occured" ) , 1 ) ); } }