MCPcopy Create free account
hub / github.com/Dobiasd/FunctionalPlus / allocate

Method allocate

test/transform_test.cpp:212–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210 mallocator(const mallocator<U>&) { }
211
212 T* allocate(std::size_t n)
213 {
214 if (n <= std::numeric_limits<std::size_t>::max() / sizeof(T)) {
215 if (auto ptr = std::malloc(n * sizeof(T))) {
216 return static_cast<T*>(ptr);
217 }
218 }
219 throw std::bad_alloc();
220 }
221 void deallocate(T* ptr, std::size_t)
222 {
223 std::free(ptr);

Callers

nothing calls this directly

Calls 1

maxFunction · 0.50

Tested by

no test coverage detected