the.bay.news

Avoiding large stack frames by passing &mut self instead of self

The Rust Programming Language Forum
Avoiding large stack frames by passing &mut self instead of self
I will be using the glam crate as an example for my question but I am trying to understand stack frame allocation in the general sense. Looking at DMat4 from glam crate, there are methods such Add and Mul that take self and Self return Self. DMat4 implements Copy. I can do a series of computations like: fn bar() -> DMat4 { let mat_a = DMat4::default(); let mat_b = mat_a.add(other_mat); let mat_c = mat_b.add(another_mat); … one-hundred-similar-lines let mat_d = mat_c.add(yet_another_ma...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.