Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-742

size of Error and ErrorKind is too large

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.0-beta
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      mongodb rust driver version: 2.0.0.alpha.1

      std::mem::size_of::<mongodb::error::Error>() = 320
      std::mem::size_of::<mongodb::error::ErrorKind>() = 296

      It's not recommend to pass large object between function,

      I think Error or ErrorKind should allocate in heap memory and return a reference on function return value type

       

      `pubkind: ErrorKind` on mongodb::error::Error should change to `pubkind: Box<ErrorKind>`

       

      It's not effective to transfer 320 bytes mongodb::error::Error on stack memory

            Assignee:
            patrick.freed@mongodb.com Patrick Freed
            Reporter:
            os.popen@gmail.com rust matcher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: