Get the latest tech news
Placing Functions
placing functions — 2025-07-08 - what are placing functions? - a basic desugaring - thinking in placing functions - prior art in rust - q&a - conclusion What are placing functions? About a year ago I observed that in-place construction seems surprisingly simple. By separating the creating of the place in memory from writing the value to memory, it’s not that hard to see how we can turn that into a language feature.
[!quote] If the type has class MEMORY, then the caller provides space for the return value and passes the address of this storage in%rdi as if it were the first argument to the function. It also begs the question: how easy it would be to modify rustc's ABI lowering code for x64 to just say"if the type was declared with the placing attribute, it's always classified as MEMORY”? Back in March Eric Holk and Tyler Mandry argued that we’ll also want to have some form of placing arguments(or at least the capability that enables us to do this).
Or read this on Hacker News