diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-07-17 19:23:16 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | 84e65c63e7482590d535e86f7660a00ae8a0cecb (patch) | |
tree | c79de87b7136e96b977003db85d43e5e676bbfc1 /include/program.h | |
parent | 85c654a102701958d3748e82ecac9c1bc4dbbcba (diff) |
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.
Diffstat (limited to 'include/program.h')
-rw-r--r-- | include/program.h | 18 |
1 files changed, 18 insertions, 0 deletions
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 |