public static unsafe void DumpAotProfileData(ref byte buf, int len, string extraArg) { if (len == 0) { throw new JSException("Profile data length is 0"); } var arr = new byte[len]; fixed(void *p = &buf) { var span = new ReadOnlySpan <byte>(p, len); // Send it to JS var module = (JSObject)Runtime.GetGlobalObject("Module"); module.SetObjectProperty("aot_profile_data", Uint8Array.From(span)); } }