MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / create_array

Function create_array

concurrentqueue.h:3626–3636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3624
3625 template<typename U>
3626 static inline U* create_array(size_t count)
3627 {
3628 assert(count > 0);
3629 U* p = static_cast<U*>(aligned_malloc<U>(sizeof(U) * count));
3630 if (p == nullptr)
3631 return nullptr;
3632
3633 for (size_t i = 0; i != count; ++i)
3634 new (p + i) U();
3635 return p;
3636 }
3637
3638 template<typename U>
3639 static inline void destroy_array(U* p, size_t count)

Callers 1

allocateMethod · 0.85

Calls 1

assertClass · 0.85

Tested by 1

allocateMethod · 0.68