From db94e646e03c40a0a2acd8d124bc924f61dd39a3 Mon Sep 17 00:00:00 2001 From: flysand7 Date: Mon, 26 Aug 2024 07:21:54 +1100 Subject: [PATCH] [os2/process]: Adjust documentation for process info --- core/os/os2/process.odin | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/core/os/os2/process.odin b/core/os/os2/process.odin index f7a542276..a43ebc8d7 100644 --- a/core/os/os2/process.odin +++ b/core/os/os2/process.odin @@ -166,15 +166,15 @@ Process_Info :: struct { This procedure obtains an information, specified by `selection` parameter of a process given by `pid`. - - Use `free_process_info` to free the memory allocated by this procedure. In - case the function returns an error it may only have been an error for one part - of the information and you would still need to call it to free the other parts. + + Use `free_process_info` to free the memory allocated by this procedure. The + `free_process_info` procedure needs to be called, even if this procedure + returned an error, as some of the fields have been allocated. **Note**: The resulting information may or may contain the fields specified by the `selection` parameter. Always check whether the returned `Process_Info` struct has the required fields before checking the error code - returned by this function. + returned by this procedure. */ @(require_results) process_info_by_pid :: proc(pid: int, selection: Process_Info_Fields, allocator: runtime.Allocator) -> (Process_Info, Error) { @@ -188,14 +188,14 @@ process_info_by_pid :: proc(pid: int, selection: Process_Info_Fields, allocator: about a process that has been opened by the application, specified in the `process` parameter. - Use `free_process_info` to free the memory allocated by this procedure. In - case the function returns an error it may only have been an error for one part - of the information and you would still need to call it to free the other parts. + Use `free_process_info` to free the memory allocated by this procedure. The + `free_process_info` procedure needs to be called, even if this procedure + returned an error, as some of the fields have been allocated. **Note**: The resulting information may or may contain the fields specified by the `selection` parameter. Always check whether the returned `Process_Info` struct has the required fields before checking the error code - returned by this function. + returned by this procedure. */ @(require_results) process_info_by_handle :: proc(process: Process, selection: Process_Info_Fields, allocator: runtime.Allocator) -> (Process_Info, Error) { @@ -208,14 +208,14 @@ process_info_by_handle :: proc(process: Process, selection: Process_Info_Fields, This procedure obtains the information, specified by `selection` parameter about the currently running process. - Use `free_process_info` to free the memory allocated by this procedure. In - case the function returns an error it may only have been an error for one part - of the information and you would still need to call it to free the other parts. + Use `free_process_info` to free the memory allocated by this procedure. The + `free_process_info` procedure needs to be called, even if this procedure + returned an error, as some of the fields have been allocated. **Note**: The resulting information may or may contain the fields specified by the `selection` parameter. Always check whether the returned `Process_Info` struct has the required fields before checking the error code - returned by this function. + returned by this procedure. */ @(require_results) current_process_info :: proc(selection: Process_Info_Fields, allocator: runtime.Allocator) -> (Process_Info, Error) {