Closed nh2 closed 5 years ago
This is the cherry-pick / adjustment of my branch withHMatAsMat-opencv-0.0.2.1
for master
.
@nh2 thanks!
@roelvandijk let's if we can rewrite mkFinalizer
in terms of funPtr
or maybe we can remove it and use funPtr
directly inline (like we now do with Mats) which saves a top-level declaration.
@roelvandijk even better would be to rewrite objFromPtr
in terms of funPtr
.
See commit message for details.
In my application where I call out to CUDA while creating
Mat
s, usingwithHMatAsMat
instead ofhMatToMat
changes memory usage from linearly increasing (depending on whether I force GC) up to 20 GB to 250 MB constant memory usage.Based on #135, please merge that one first.