summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-10-01 15:16:18 -0400
committerIan Moffett <ian@osmora.org>2025-10-01 15:16:18 -0400
commit6c9d36725286e159ed6a04e79ea215789a52c29f (patch)
treead856efbd4bb1cf11e1421f473b60ac0efea41e7 /src/sys
parent4a314d3d59b9d9650c6c24e15f1ea217a6259318 (diff)
np: init: Keep track of objects with PTRBOX
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/include/os/np.h2
-rw-r--r--src/sys/np/core/np_init.c7
2 files changed, 9 insertions, 0 deletions
diff --git a/src/sys/include/os/np.h b/src/sys/include/os/np.h
index 5734e69..3bb2bb8 100644
--- a/src/sys/include/os/np.h
+++ b/src/sys/include/os/np.h
@@ -38,6 +38,7 @@
#include <sys/types.h>
#include <os/vnode.h>
#include <np/lex.h>
+#include <lib/ptrbox.h>
/*
* Compiler work
@@ -53,6 +54,7 @@ struct np_work {
size_t source_size;
size_t line_no;
struct lexer_state lex_st;
+ struct ptrbox *work_mem;
char ccache;
};
diff --git a/src/sys/np/core/np_init.c b/src/sys/np/core/np_init.c
index 63d2ff2..d7d7b48 100644
--- a/src/sys/np/core/np_init.c
+++ b/src/sys/np/core/np_init.c
@@ -61,7 +61,14 @@ np_init(const char *in_path, struct np_work *workp)
return error;
}
+ error = ptrbox_init(&workp->work_mem);
+ if (error < 0) {
+ pr_trace("could not init ptrbox\n");
+ return error;
+ }
+
parse_work(workp);
+ ptrbox_terminate(workp->work_mem);
return 0;
}