Skip to content

allocator returned from ortApiGetAllocatorWithDefaultOptions should not be freed #9

@Lucus16

Description

@Lucus16

When you actually try to use ortApiGetAllocatorWithDefaultOptions, you get free(): invalid pointer. This is because ortApiGetAllocatorWithDefaultOptions internally calls wrapCOrtAllocator which calls ReleaseAllocator in the finalizer but the documentation of ortApiGetAllocatorWithDefaultOptions states:

[out] out Returned value should NOT be freed

I'm willing to fix this but I'm not sure whether you want wrapCOrtAllocator to keep calling ReleaseAllocator and therefor to avoid using wrapCOrtAllocator in ortApiGetAllocatorWithDefaultOptions or whether you want to remove the call to ReleaseAllocator, but then you need something new in case you ever use another kind of allocator that does need to be released.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions