> If we pass GpuMat*, all Allocator implementations should do more work : setup all GpuMat members like flag, datastart, dataend, etc.
> I don't think it is a good idea. Allocator must only allocate memory and return pointers, and GpuMat must setup own fields in appropriate way.

You still ask to fill `data`, `step` and `refcount` pointers. But pass only one parameter instead of three. Allocator should not work with other GpuMat-only fields.

I see these benefits:
- Looks better.
- Extendable. For example, you can create some smart allocator that switches between low-level allocators (strategy may be based on size of matrix). And after selection it assigns to `allocator` field a new value, that says how to deallocate this.
This modification will not break binary compatibility if you will pass GpuMat.
- You mark that Allocator works with GpuMat, not with three fields from somewhere else (for example you will newer pass these fields from cv::Mat).