Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

[Experimental simulators] Improve C API exposed by qdk_sim_rs. #732

Open
@cgranade

Description

@cgranade

As suggested by @kuzminrobin, there's several opportunities available to improve c_api.rs to better align with C API design guidelines and to offer a more robust interface from C callers into the Rust library:

  • Add new deallocate_string function. To ensure that strings are allocated and deallocated in the same binary, C callers should be able to return ownership of strings back to Rust for deallocation.
  • Change usize to u64. Since usize is architecture-dependent, changing to u64 is more portable.
  • Granular return codes. Return codes from C API functions could be differentiated (as opposed to all -1) to allow for more granular reporting of errors to C-language callers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceImprove codebase quality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions