Reinitialize memory pool on each loop of the REPL

This commit is contained in:
2024-10-24 21:35:25 +01:00
parent e5cd69c26b
commit ecd50c76c5
4 changed files with 2 additions and 8 deletions

View File

@@ -22,7 +22,6 @@ typedef struct {
char result_buffer[REPL_RESULT_BUFFER_SIZE];
} repl_t;
void init_repl(repl_t *repl);
bool step_repl(repl_t *repl);
void run_repl(repl_t *repl);

View File

@@ -3,13 +3,10 @@
#include <stdio.h>
#include <string.h>
void init_repl(repl_t *repl)
{
init_memory_pool(&repl->pool);
}
bool step_repl(repl_t *repl)
{
init_memory_pool(&repl->pool);
int len;
for (len = 0; len < REPL_LINE_BUFFER_SIZE; ++len) {
const int byte = repl->get_byte();