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

Function pinnedAlloc

src/backend/cpu/memory.cpp:88–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87template<typename T>
88T *pinnedAlloc(const size_t &elements) {
89 // TODO: make pinnedAlloc aware of array shapes
90 dim4 dims(elements);
91 void *ptr = memoryManager().alloc(false, 1, dims.get(), sizeof(T));
92 return static_cast<T *>(ptr);
93}
94
95void pinnedFree(void *ptr) { memoryManager().unlock(ptr, false); }
96

Callers

nothing calls this directly

Calls 2

allocMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected