Skip to content

Commit

Permalink
[CN-Exec] Add reset_fulminate for initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ZippeyKeys12 committed Feb 13, 2025
1 parent 35d5e87 commit 99b260a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions runtime/libcn/include/cn-executable/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
extern "C" {
#endif

void reset_fulminate(void);

enum cn_logging_level {
CN_LOGGING_NONE = 0,
CN_LOGGING_ERROR = 1,
Expand Down
6 changes: 1 addition & 5 deletions runtime/libcn/include/cn-testing/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,7 @@ void cn_trap(void);
int cn_test_main(int argc, char* argv[]);

#define CN_TEST_INIT() \
cn_bump_free_all(); \
cn_fl_free_all(); \
reset_error_msg_info(); \
initialise_ownership_ghost_state(); \
initialise_ghost_stack_depth(); \
reset_fulminate(); \
cn_gen_backtrack_reset(); \
cn_gen_alloc_reset(); \
cn_gen_ownership_reset();
Expand Down
7 changes: 7 additions & 0 deletions runtime/libcn/src/cn-executable/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ signed long cn_stack_depth;

signed long nr_owned_predicates;

void reset_fulminate(void) {
cn_bump_free_all();
cn_fl_free_all();
reset_error_msg_info();
initialise_ownership_ghost_state();
initialise_ghost_stack_depth();
}

static enum cn_logging_level logging_level = CN_LOGGING_INFO;

Expand Down

0 comments on commit 99b260a

Please sign in to comment.