Skip to content

[WASM] Better double (F64) support in MonoPlatform.ts #65959

Closed

Description

@GeroL

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I am sending many double arrays per Unmarshalled invokes to my JS functions
I saw the Blazor.platform.toUint8Array function but it seems that this is the only helper function so far

Describe the solution you'd like

It could be new APIs like toFloat(32/64)Array like here
Also some helper functions could be implemented like the ones for float (F32)

Additional context

The types for F64 support are implemented here https://github.com/dotnet/aspnetcore/blob/main/src/Components/Web.JS/@types/dotnet/dotnet.d.ts

I have now a function in javascript like this:

function toFloat64Array(array){
    const dataPtr = Blazor.platform.getArrayDataPointer(array);
    const length = Blazor.platform.getValueI32(dataPtr);
    const f64Array = new Float64Array(length);
    f64Array.set(Module.HEAPF64.subarray(dataPtr + 4, dataPtr + 4 + length));
    return f64Array;
}

I wasn't able to test it due to lack of time.

Activity

  1. transferred this issue fromdotnet/aspnetcoreon Feb 28, 2022
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Feb 28, 2022
  3. removed
    untriagedNew issue has not been triaged by the area owner
    on Feb 28, 2022
  4. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 6, 2022
  5. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jul 10, 2022
  6. ghost locked as resolved and limited conversation to collaborators on Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions