MCPcopy Create free account
hub / github.com/Xilinx/xfopencv / allocate

Method allocate

examples_sdaccel/threshold/xcl2.hpp:55–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53{
54 using value_type = T;
55 T* allocate(std::size_t num)
56 {
57 void* ptr = nullptr;
58 if (posix_memalign(&ptr,4096,num*sizeof(T)))
59 throw std::bad_alloc();
60 return reinterpret_cast<T*>(ptr);
61 }
62 void deallocate(T* p, std::size_t num)
63 {
64 free(p);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected