diff --git a/core/state.c b/core/state.c index 4a9f47a..4f81e4f 100644 --- a/core/state.c +++ b/core/state.c @@ -32,6 +32,11 @@ quip_state_init(const char *build_file, struct quip_state *state) return -1; } + if (ptrbox_init(&state->ptrbox) < 0) { + close(state->in_fd); + return -1; + } + return 0; } @@ -42,6 +47,7 @@ quip_state_destroy(struct quip_state *state) return; } + ptrbox_destroy(&state->ptrbox); close(state->in_fd); state->in_fd = -1; } diff --git a/include/common/state.h b/include/common/state.h index 05f1c33..923f298 100644 --- a/include/common/state.h +++ b/include/common/state.h @@ -14,6 +14,7 @@ #include #include #include "common/knobs.h" +#include "common/ptrbox.h" /* * Represents the build state machine @@ -24,6 +25,7 @@ * @lex_buf_cap: Lexer buffer capacity * @lex_buf_i: Lexer buffer index * @lex_putback: Lexer putback buffer + * @ptrbox: Global pointer box */ struct quip_state { int in_fd; @@ -32,6 +34,7 @@ struct quip_state { size_t lex_buf_cap; size_t lex_buf_i; char lex_putback; + struct ptrbox ptrbox; }; /*