MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / memAlloc

Function memAlloc

src/backend/cpu/memory.cpp:57–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55
56template<typename T>
57unique_ptr<T[], function<void(void *)>> memAlloc(const size_t &elements) {
58 // TODO: make memAlloc aware of array shapes
59 dim4 dims(elements);
60 T *ptr = static_cast<T *>(
61 memoryManager().alloc(false, 1, dims.get(), sizeof(T)));
62 return unique_ptr<T[], function<void(void *)>>(ptr, memFree);
63}
64
65void *memAllocUser(const size_t &bytes) {
66 dim4 dims(bytes);

Callers

nothing calls this directly

Calls 2

allocMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected