MCPcopy Create free account
hub / github.com/Tencent/plato / create_array

Function create_array

plato/util/concurrentqueue.h:3492–3504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3490
3491 template<typename U>
3492 static inline U* create_array(size_t count)
3493 {
3494 assert(count > 0);
3495 auto p = static_cast<U*>((Traits::malloc)(sizeof(U) * count));
3496 if (p == nullptr) {
3497 return nullptr;
3498 }
3499
3500 for (size_t i = 0; i != count; ++i) {
3501 new (p + i) U();
3502 }
3503 return p;
3504 }
3505
3506 template<typename U>
3507 static inline void destroy_array(U* p, size_t count)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected