ExecutorScope.create constructor

ExecutorScope.create(
  1. Executor executor, {
  2. String? name,
})

Implementation

factory ExecutorScope.create(Executor executor, {String? name}) {
  if (name == null) {
    return ExecutorScope.fromPointer(C.mnn_executor_scope_create(executor.ptr));
  }
  final cName = name.toNativeUtf8().cast<ffi.Char>();
  try {
    return ExecutorScope.fromPointer(C.mnn_executor_scope_create_with_name(cName, executor.ptr));
  } finally {
    calloc.free(cName);
  }
}