From 84e65c63e7482590d535e86f7660a00ae8a0cecb Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 17 Jul 2019 19:23:16 +0200 Subject: Start on amal program Fix mutex issue in lhs expr which can cause a deadlock when a file has an error and throws and doesn't close the mutex and another thread waits for that mutex. The mutex can instead be removed and ignore race conditions which are uncommon. This should improve memory usage and performance. --- include/program.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 include/program.h (limited to 'include/program.h') diff --git a/include/program.h b/include/program.h new file mode 100644 index 0000000..cbd9432 --- /dev/null +++ b/include/program.h @@ -0,0 +1,18 @@ +#ifndef AMAL_PROGRAM_H +#define AMAL_PROGRAM_H + +#include "std/buffer.h" +#include "bytecode/bytecode.h" + +typedef struct { + Buffer/*<...>*/ data; +} amal_program; + +void amal_program_init(amal_program *self); +void amal_program_deinit(amal_program *self); + +CHECK_RESULT int amal_program_append_bytecode(amal_program *self, Bytecode *bytecode); +CHECK_RESULT int amal_program_run(amal_program *self); +CHECK_RESULT int amal_program_save(amal_program *self, const char *filepath); + +#endif -- cgit v1.2.3