File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,14 +129,13 @@ Jai has a unique take on how to deal with reference vs value semantics.
129129
130130Arguments to procedures fall into two basic categories:
131131
132- - ` small ` (basic types that are <= 8 bytes)
132+ - ` small ` -> basic types that are less than or equal to 8 bytes.
133+ - ` big ` -> any type larger than 8 bytes, and any struct regardless of size.
133134
134135The ` small ` arguments are always passed by value into a procedure. They fit into simple machine
135136registers on a 64-bit machine, so it would be less efficient to pass them by reference than
136137by value. So they are always passed by value. These arguments behave the same as they do in C.
137138
138- - ` big ` (any type > 8 bytes, and any struct regardless of size)
139-
140139The ` big ` arguments are passed maybe by reference. But in terms of language semantics, it looks like
141140you have a copy of the struct by value. It behaves like a ` const& ` parameter would
142141behave in C++, so you can't modify it even though it was passed by reference.
You can’t perform that action at this time.
0 commit comments