Skip to content

Commit 2737ebe

Browse files
committed
fixed dynarrays are ref types
1 parent 93fb224 commit 2737ebe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

content/posts/odin-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ A slice is just a view into an existing array, a slice is basically a pointer an
313313

314314
Dynamic arrays are similar to slices, but their lengths may change during runtime. Dynamic arrays are resizeable and they are allocated when needed using the current context allocator.
315315

316-
Slices and dynamic arrays are simple small structures with a pointer to an underlying array, therefore copying or passing a slice or dynamic array will not copy the underlying data. Because of this they work kinda like reference types.
316+
Slices and dynamic arrays are simple small structures with a pointer to an underlying array, therefore copying or passing a slice or dynamic array will not copy the underlying data. Because of this they work kinda like reference types. Fixed capacity dynamic arrays do however copy the data
317317

318318
The zero value of a slice is nil. A nil slice has a length of 0 and does not point to any underlying memory. Slices can be compared against nil and nothing else.
319319

0 commit comments

Comments
 (0)