Commit f69b85ff authored by Neal H. Walfield's avatar Neal H. Walfield
Browse files

Explicitly panic when out of memory.

  - Change `rust_str_to_c_str` and `rust_bytes_to_c_str_lossy` to
    return a `Result`.

  - Return `Error::OutOfMemory` if `malloc` fails instead of undefined
    behavior.

  - Update the callers to propagate the error when convenient and to
    panic explicitly when not.

    - Note: Rust panics if a memory allocation fails so we don't go
      too far out of the way to propagate memory allocation errors.
parent 4b05eb03
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment