aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/process.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-02-17 20:33:11 +0100
committerbfredl <bjorn.linse@gmail.com>2024-02-18 10:36:07 +0100
commit146333ca123ab85397eb089345569cd9ed2d405a (patch)
treed98356e848e3f893953f98f257032b72775cdeb7 /src/nvim/os/process.c
parentf25fcc68a34c2d51b0715fadc62cb50509de338b (diff)
downloadrneovim-146333ca123ab85397eb089345569cd9ed2d405a.tar.gz
rneovim-146333ca123ab85397eb089345569cd9ed2d405a.tar.bz2
rneovim-146333ca123ab85397eb089345569cd9ed2d405a.zip
refactor(api): use arena for channel info and terminal info
Diffstat (limited to 'src/nvim/os/process.c')
-rw-r--r--src/nvim/os/process.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c
index 5263451488..e8d38d5b8a 100644
--- a/src/nvim/os/process.c
+++ b/src/nvim/os/process.c
@@ -230,7 +230,7 @@ int os_proc_children(int ppid, int **proc_list, size_t *proc_count)
///
/// @param pid Process to inspect.
/// @return Map of process properties, empty on error.
-Dictionary os_proc_info(int pid)
+Dictionary os_proc_info(int pid, Arena *arena)
{
Dictionary pinfo = ARRAY_DICT_INIT;
PROCESSENTRY32 pe;
@@ -258,9 +258,10 @@ Dictionary os_proc_info(int pid)
CloseHandle(h);
if (pe.th32ProcessID == (DWORD)pid) {
- PUT(pinfo, "pid", INTEGER_OBJ(pid));
- PUT(pinfo, "ppid", INTEGER_OBJ((int)pe.th32ParentProcessID));
- PUT(pinfo, "name", CSTR_TO_OBJ(pe.szExeFile));
+ pinfo = arena_dict(arena, 3);
+ PUT_C(pinfo, "pid", INTEGER_OBJ(pid));
+ PUT_C(pinfo, "ppid", INTEGER_OBJ((int)pe.th32ParentProcessID));
+ PUT_C(pinfo, "name", CSTR_TO_ARENA_OBJ(arena, pe.szExeFile));
}
return pinfo;