Ask Your Question

Revision history [back]

why does matallocator have two allocate functions.

I was looking at how the opencv2 python bindings work (and in particular how they integrate with numpy) and started looking at MatAllocator. I noticed there were two "allocate" functions, one of them that returns a UMatData* and the other of which takes a UMatData* (among other parameters) and returns a bool.

In the standard, numpy and cuda_host_mem allocator implementations the former seems to do all the allocation work while the latter seems to be a null checker. Otoh in the opencl allocator both implementations seem to contain a bunch of code.

Can anyone explain the purpose of the two functions?