Skip to content

Commit

Permalink
Add vm_finalize() to clean program pointer for embed systems
Browse files Browse the repository at this point in the history
JerryScript-DCO-1.0-Signed-off-by: SaeHie Park [email protected]
  • Loading branch information
seanshpark committed Jun 5, 2015
1 parent afd532d commit 2b2f2df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions jerry-core/jerry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,7 @@ jerry_cleanup (void)
ecma_finalize ();
serializer_free ();
mem_finalize (is_show_mem_stats);
vm_finalize ();
} /* jerry_cleanup */

/**
Expand Down
9 changes: 9 additions & 0 deletions jerry-core/vm/vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,15 @@ vm_init (const opcode_t *program_p, /**< pointer to byte-code program */
__program = program_p;
} /* vm_init */

/**
* Cleanup interpreter
*/
void
vm_finalize (void)
{
__program = NULL;
} /* vm_finalize */

/**
* Run global code
*/
Expand Down
1 change: 1 addition & 0 deletions jerry-core/vm/vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "opcodes.h"

extern void vm_init (const opcode_t* program_p, bool dump_mem_stats);
extern void vm_finalize (void);
extern jerry_completion_code_t vm_run_global (void);
extern ecma_completion_value_t vm_loop (int_data_t *int_data);
extern ecma_completion_value_t vm_run_from_pos (opcode_counter_t start_pos,
Expand Down

0 comments on commit 2b2f2df

Please sign in to comment.