Zig: add documentation for Result Location Semantics

Created on 3 Jul 2019  路  2Comments  路  Source: ziglang/zig

  • [ ] how result locations flow across expressions

    • [ ] variables

    • [ ] struct initialization

    • [ ] array initialization

    • [ ] union initialization

    • [ ] if

    • [ ] while

    • [ ] switch

    • [ ] return

    • [ ] function calls - return values & parameters

    • [ ] catch

    • [ ] orelse

    • [ ] @bitCast

  • [ ] mention #2761 and #2765
docs

Most helpful comment

What is a Result Location?

All 2 comments

What is a Result Location?

Here鈥檚 the original issue: https://github.com/ziglang/zig/issues/287

My best summary: when a function returns a newly created value, it will automatically put it into the function鈥檚 return location instead of making a copy. Previously, this was only a potential optimization from LLVM, but now it鈥檚 guaranteed by Zig.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dobkeratops picture dobkeratops  路  3Comments

zimmi picture zimmi  路  3Comments

S0urc3C0de picture S0urc3C0de  路  3Comments

bheads picture bheads  路  3Comments

bronze1man picture bronze1man  路  3Comments