Skip to content

Commit

Permalink
pull julia_save out of the external API and into the atexit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Jul 17, 2015
1 parent a8e9189 commit b4e4b4b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ static void jl_uv_exitcleanup_walk(uv_handle_t *handle, void *arg)

void jl_write_coverage_data(void);
void jl_write_malloc_log(void);
static void julia_save(void);

static struct uv_shutdown_queue_item *next_shutdown_queue_item(struct uv_shutdown_queue_item *item)
{
Expand All @@ -551,6 +552,7 @@ static struct uv_shutdown_queue_item *next_shutdown_queue_item(struct uv_shutdow

DLLEXPORT void jl_atexit_hook()
{
julia_save();
#if defined(GC_FINAL_STATS)
jl_print_gc_stats(JL_STDERR);
#endif
Expand Down Expand Up @@ -1282,7 +1284,7 @@ DLLEXPORT int jl_generating_output()

void jl_compile_all(void);

DLLEXPORT void julia_save()
static void julia_save()
{
if (jl_options.compile_enabled == JL_OPTIONS_COMPILE_ALL)
jl_compile_all();
Expand Down
5 changes: 3 additions & 2 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -1141,8 +1141,9 @@ DLLEXPORT ios_t *jl_create_system_image();
DLLEXPORT void jl_save_system_image(const char *fname);
DLLEXPORT void jl_restore_system_image(const char *fname);
DLLEXPORT void jl_restore_system_image_data(const char *buf, size_t len);
DLLEXPORT int jl_save_new_module(const char *fname, jl_module_t *mod);
DLLEXPORT jl_module_t *jl_restore_new_module(const char *fname);
DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t* worklist);
DLLEXPORT jl_array_t *jl_restore_incremental(const char *fname);
DLLEXPORT jl_array_t *jl_restore_incremental_from_buf(const char *buf, size_t sz);
void jl_init_restored_modules();

// front end interface
Expand Down
3 changes: 0 additions & 3 deletions ui/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,6 @@ static int true_main(int argc, char *argv[])
return 0;
}

DLLEXPORT extern void julia_save();

#ifndef _OS_WINDOWS_
int main(int argc, char *argv[])
{
Expand Down Expand Up @@ -571,7 +569,6 @@ int wmain(int argc, wchar_t *argv[], wchar_t *envp[])
}
julia_init(imagepathspecified ? JL_IMAGE_CWD : JL_IMAGE_JULIA_HOME);
int ret = true_main(argc, (char**)argv);
julia_save();
jl_atexit_hook();
return ret;
}
Expand Down

0 comments on commit b4e4b4b

Please sign in to comment.