why does matallocator have two allocate functions.

asked 2020-05-20 18:31:16 -0500

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?

edit retag flag offensive close merge delete