struct Ray { Vector3f origin; Vector3f dir; @nogc @system this(Vector3f *origin, Vector3f *dir) { this.origin = *origin; this.dir = *dir; } } How can I pass struct more efficiently?
Efficient way to pass struct as parameter
Tim Hsu via Digitalmars-d-learn Tue, 02 Jan 2018 10:26:37 -0800
I am creating Vector3 structure. I use struct to avoid GC.
However, struct will be copied when passed as parameter to
function
- Efficient way to pass struct as p... Tim Hsu via Digitalmars-d-learn
- Re: Efficient way to pass st... Jonathan M Davis via Digitalmars-d-learn
- Re: Efficient way to pass st... Seb via Digitalmars-d-learn
- Re: Efficient way to pass st... Igor Shirkalin via Digitalmars-d-learn
- Re: Efficient way to pas... Jonathan M Davis via Digitalmars-d-learn
- Re: Efficient way to pass st... Johan Engelen via Digitalmars-d-learn
- Re: Efficient way to pas... Jonathan M Davis via Digitalmars-d-learn
- Re: Efficient way to pas... H. S. Teoh via Digitalmars-d-learn
- Re: Efficient way to pas... Tim Hsu via Digitalmars-d-learn
- Re: Efficient way to... H. S. Teoh via Digitalmars-d-learn
- Re: Efficient way to... Jacob Carlborg via Digitalmars-d-learn