Data ownership design patterns? Feasible or not?

There's no magic to how we solved the memory management issues.

  • clone() is your friend when conversing with the borrow checker.
  • Don't put references in your structs.
  • Don't share mutable data; use a channel to send changes to its owner.
  • Don't worry about performance until you have a performance problem.

You can probably infer the last one from the first three.

6 Likes