Fix memory leaks
This commit is contained in:
@@ -79,9 +79,24 @@ struct Inst {
|
||||
int idx;
|
||||
};
|
||||
|
||||
struct Thread {
|
||||
Inst *pc;
|
||||
uint32_t saved[40]; /* $0 through $9 */
|
||||
};
|
||||
|
||||
struct ThreadList {
|
||||
Thread *t;
|
||||
int n;
|
||||
};
|
||||
|
||||
Exp *regex_to_ast(std::string pattern);
|
||||
void free_exp(Exp *exp);
|
||||
Inst *compile_ast(Exp *root);
|
||||
Inst *compile_regex(std::string pattern);
|
||||
int next_match(Inst *prog, ByteIterator *it, uint32_t *saved);
|
||||
int proglen(Inst *prog);
|
||||
void free_program(Inst *instructions);
|
||||
int next_match(Inst *prog, ByteIterator *it, uint32_t *saved, ThreadList *clist,
|
||||
ThreadList *nlist);
|
||||
void print_program(Inst *program);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user