Skip to content

Commit 315e418

Browse files
committed
changes
1 parent 08c3c0d commit 315e418

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

content/posts/jai-guide.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,13 @@ Jai has a unique take on how to deal with reference vs value semantics.
129129

130130
Arguments 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

134135
The `small` arguments are always passed by value into a procedure. They fit into simple machine
135136
registers on a 64-bit machine, so it would be less efficient to pass them by reference than
136137
by 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-
140139
The `big` arguments are passed maybe by reference. But in terms of language semantics, it looks like
141140
you have a copy of the struct by value. It behaves like a `const&` parameter would
142141
behave in C++, so you can't modify it even though it was passed by reference.

0 commit comments

Comments
 (0)