MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / allocate

Method allocate

extern/boost/boost/container/new_allocator.hpp:155–161  ·  view source on GitHub ↗

Allocates memory for an array of count elements. Throws bad_alloc if there is no enough memory

Source from the content-addressed store, hash-verified

153 //!Allocates memory for an array of count elements.
154 //!Throws bad_alloc if there is no enough memory
155 pointer allocate(size_type count)
156 {
157 const std::size_t max_count = std::size_t(-1)/(2*sizeof(T));
158 if(BOOST_UNLIKELY(count > max_count))
159 throw_bad_alloc();
160 return static_cast<T*>(::operator new(count*sizeof(T)));
161 }
162
163 //!Deallocates previously allocated memory.
164 //!Never throws

Calls 3

size_tClass · 0.85
throw_bad_allocFunction · 0.85
operator newFunction · 0.50

Tested by

no test coverage detected