cvRunArena<R> function
R
cvRunArena<R>(])
Implementation
R cvRunArena<R>(
R Function(Arena arena) computation, [
ffi.Allocator wrappedAllocator = calloc,
bool keep = false,
]) {
final arena = Arena(wrappedAllocator);
bool isAsync = false;
try {
final result = computation(arena);
if (result is Future) {
isAsync = true;
return result.whenComplete(arena.releaseAll) as R;
}
return result;
} finally {
if (!isAsync && !keep) {
arena.releaseAll();
}
}
}