pub unsafe extern "C" fn Dart_CreateAppAOTSnapshotAsElf(
    callback: Dart_StreamingWriteCallback,
    callback_data: *mut c_void,
    stripped: bool,
    debug_callback_data: *mut c_void
) -> Dart_Handle
Expand description

Creates a precompiled snapshot.

  • A root library must have been loaded.
  • Dart_Precompile must have been called.

Outputs an ELF shared library defining the symbols

  • _kDartVmSnapshotData
  • _kDartVmSnapshotInstructions
  • _kDartIsolateSnapshotData
  • _kDartIsolateSnapshotInstructions

The shared library should be dynamically loaded by the embedder. Running this snapshot requires a VM compiled with DART_PRECOMPILED_SNAPSHOT. The kDartVmSnapshotData and kDartVmSnapshotInstructions should be passed to Dart_Initialize. The kDartIsolateSnapshotData and kDartIsolateSnapshotInstructions should be passed to Dart_CreateIsolate.

The callback will be invoked one or more times to provide the binary output.

If stripped is true, then the binary output will not include DWARF debugging sections.

If debug_callback_data is provided, debug_callback_data will be used with the callback to provide separate debugging information.

\return A valid handle if no error occurs during the operation.