CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace utils {
33 return std::unique_ptr<T>(reinterpret_cast<T*>(::
operator new(
size)));
42 return std::shared_ptr<T>(reinterpret_cast<T*>(::
operator new(
size)));
48 return std::move(pointer);
std::unique_ptr< T > MakeUniqueWithSize(size_t size)
Creates a unique pointer of the specified type with custom size.
Definition: MemoryUtils.h:29
std::shared_ptr< T > UniqueToShared(std::unique_ptr< T > &&pointer)
Converts a unique pointer to a shared pointer of the same type.
Definition: MemoryUtils.h:47
uint64_t size
Definition: MemoryCounters.cpp:65
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
Definition: AddressExtractionExtension.cpp:28
std::shared_ptr< T > MakeSharedWithSize(size_t size)
Creates a shared pointer of the specified type with custom size.
Definition: MemoryUtils.h:38