Skip to content

Pointer.asTypedList should allow user to specify a finalizer. #50507

Closed
@mraleph

Description

@mraleph

Proposed extension:

XyzList Pointer<Xyz>.asTypedList(int length, {NativeFinalizerFunction finalizer})

You can't put typed list into NativeFinalizer because they don't extend Finalizable (even though they behave a bit like one - we never cache internal data pointer and let typed data die).

Users currently work around this limitation by creating a Finalizable object and linking its lifetime to that of typed data through Expando. It would be nice if such workarounds were unnecessary

We should take this into account when exposing external strings as well.

/cc @dcharkes
/cc @Haidar0096

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-ffi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions