MCPcopy Create free account
hub / github.com/dmlc/dmlc-core / create_array

Function create_array

include/dmlc/concurrentqueue.h:3581–3592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3579
3580 template<typename U>
3581 static inline U *create_array(size_t count) {
3582 assert(count > 0);
3583 auto p = static_cast<U *>((Traits::malloc)(sizeof(U) * count));
3584 if (p == nullptr) {
3585 return nullptr;
3586 }
3587
3588 for (size_t i = 0; i != count; ++i) {
3589 new(p + i) U();
3590 }
3591 return p;
3592 }
3593
3594 template<typename U>
3595 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