Function dart_sys::Dart_WriteHeapSnapshot
source · pub unsafe extern "C" fn Dart_WriteHeapSnapshot(
write: Dart_HeapSnapshotWriteChunkCallback,
context: *mut c_void
) -> *mut c_char
Expand description
Generate heap snapshot of the current isolate group and stream it into the
given callback
. VM would produce snapshot in chunks and send these chunks
one by one back to the embedder by invoking the provided callback
.
This API enables embedder to stream snapshot into a file or socket without allocating a buffer to hold the whole snapshot in memory.
The isolate group will be paused for the duration of this operation.
\param write Callback used to write chunks of the heap snapshot.
\param context Opaque context which would be passed on each invocation of
write
callback.
\returns nullptr
if the operation is successful otherwise error message.
Caller owns error message string and needs to free
it.