Browse Source

Add documentation to `os2.close`

Make it explicit that using a stream after closing is like a
use-after-free bug.
Feoramund 11 months ago
parent
commit
e7d6e2d163
1 changed files with 6 additions and 0 deletions
  1. 6 0
      core/os/os2/file.odin

+ 6 - 0
core/os/os2/file.odin

@@ -132,6 +132,12 @@ name :: proc(f: ^File) -> string {
 	return _name(f)
 }
 
+/*
+	Close a file and its stream.
+
+	Any further use of the file or its stream should be considered to be in the
+	same class of bugs as a use-after-free.
+*/
 close :: proc(f: ^File) -> Error {
 	if f != nil {
 		return io.close(f.stream)