Rust Stack vs Heap usage

7f408bc67dc9ae3b288ee92d16d3c4c2?s=47 Deepu K Sasidharan
March 29, 2020
9.1k

Rust Stack vs Heap usage

7f408bc67dc9ae3b288ee92d16d3c4c2?s=128

Deepu K Sasidharan

March 29, 2020
Tweet

Transcript

  1. Rust Memory usage Heap Thread stack main frame

  2. Rust Memory usage Heap Thread stack main frame john Employee:new

    name salary 5000 sales 5 bonus 0 Box<“John”>
  3. Rust Memory usage Heap Thread stack main frame john name

    salary 5000 sales 5 bonus 0 Box<“John”>
  4. Rust Memory usage Heap Thread stack main frame john name

    salary 5000 sales 5 bonus 0 Box<“John”> find_employee_bonus salary no_of_sales 5
  5. Rust Memory usage Heap Thread stack main frame john name

    salary 5000 sales 5 bonus 0 Box<“John”> find_employee_bonus salary no_of_sales 5 bonus_percentage 0
  6. Rust Memory usage Heap Thread stack main frame john name

    salary 5000 sales 5 bonus 0 Box<“John”> find_employee_bonus salary no_of_sales 5 bonus_percentage 0 get_bonus_percentage salary
  7. Rust Memory usage Heap Thread stack main frame john name

    salary 5000 sales 5 bonus 0 Box<“John”> find_employee_bonus salary no_of_sales 5 bonus_percentage 0 get_bonus_percentage salary percentage 500
  8. Rust Memory usage Heap Thread stack main frame john name

    salary 5000 sales 5 bonus 0 Box<“John”> find_employee_bonus salary no_of_sales 5 bonus_percentage 0 get_bonus_percentage salary percentage 500 return 500
  9. Rust Memory usage Heap Thread stack main frame john name

    salary 5000 sales 5 bonus 0 Box<“John”> find_employee_bonus salary no_of_sales 5 bonus_percentage 500
  10. Rust Memory usage Heap Thread stack main frame john name

    salary 5000 sales 5 bonus 0 Box<“John”> find_employee_bonus salary no_of_sales 5 bonus_percentage 500 bonus 2500
  11. Rust Memory usage Heap Thread stack main frame john name

    salary 5000 sales 5 bonus 0 Box<“John”> find_employee_bonus salary no_of_sales 5 bonus_percentage 500 bonus 2500 return 2500
  12. Rust Memory usage Heap Thread stack main frame john name

    salary 5000 sales 5 bonus 2500 Box<“John”>
  13. Rust Memory usage Heap Thread stack