Re:C-for-all: Extending C with modern safety and productivit...
by flohofwoe on Wednesday December 04, 2019 @07:23AM
(#21701558)
It lives on the stack and is handed around by value, the question of ownership really only gets interesting once heap memory and pointers/references come into play.
I guess ancient C compilers would do a memory copy on return, but there are various optimizations in "newer" compilers which remove redundant copies, and structs up to 16 bytes or so are passed in registers anyway (via the 64-bit Intel and ARM ABI conventions).
I guess ancient C compilers would do a memory copy on return, but there are various optimizations in "newer" compilers which remove redundant copies, and structs up to 16 bytes or so are passed in registers anyway (via the 64-bit Intel and ARM ABI conventions).