Separated load_path init from loading pre.slime
This commit is contained in:
@@ -492,6 +492,7 @@ namespace Slime {
|
|||||||
|
|
||||||
proc interprete_file (char* file_name) -> Lisp_Object* {
|
proc interprete_file (char* file_name) -> Lisp_Object* {
|
||||||
try Memory::init();
|
try Memory::init();
|
||||||
|
try Memory::load_pre();
|
||||||
|
|
||||||
Lisp_Object* result;
|
Lisp_Object* result;
|
||||||
|
|
||||||
@@ -502,6 +503,7 @@ namespace Slime {
|
|||||||
|
|
||||||
proc interprete_stdin() -> void {
|
proc interprete_stdin() -> void {
|
||||||
try_void Memory::init();
|
try_void Memory::init();
|
||||||
|
try_void Memory::load_pre();
|
||||||
|
|
||||||
printf("Welcome to the lispy interpreter.\n%s\n", version_string);
|
printf("Welcome to the lispy interpreter.\n%s\n", version_string);
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ namespace Slime {
|
|||||||
Environment* create_built_ins_environment();
|
Environment* create_built_ins_environment();
|
||||||
Lisp_Object* create_lisp_object_cfunction(bool is_special);
|
Lisp_Object* create_lisp_object_cfunction(bool is_special);
|
||||||
void init();
|
void init();
|
||||||
|
void load_pre();
|
||||||
char* get_c_str(String);
|
char* get_c_str(String);
|
||||||
void free_everything();
|
void free_everything();
|
||||||
String create_string(const char*);
|
String create_string(const char*);
|
||||||
|
|||||||
+7
-5
@@ -128,7 +128,7 @@ namespace Slime::Memory {
|
|||||||
|
|
||||||
// free the exe dir:
|
// free the exe dir:
|
||||||
free(Globals::load_path.data[0]);
|
free(Globals::load_path.data[0]);
|
||||||
Globals::load_path.dealloc();
|
// Globals::load_path.dealloc();
|
||||||
Globals::docs.dealloc();
|
Globals::docs.dealloc();
|
||||||
Globals::Current_Execution::envi_stack.dealloc();
|
Globals::Current_Execution::envi_stack.dealloc();
|
||||||
Globals::Current_Execution::cs.dealloc();
|
Globals::Current_Execution::cs.dealloc();
|
||||||
@@ -171,6 +171,11 @@ namespace Slime::Memory {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc load_pre() -> void {
|
||||||
|
String file_name = Memory::create_string("pre.slime");
|
||||||
|
defer_free(file_name.data);
|
||||||
|
try_void built_in_load(file_name);
|
||||||
|
}
|
||||||
proc init() -> void {
|
proc init() -> void {
|
||||||
profile_this();
|
profile_this();
|
||||||
|
|
||||||
@@ -199,7 +204,7 @@ namespace Slime::Memory {
|
|||||||
Globals::Current_Execution::mes.alloc();
|
Globals::Current_Execution::mes.alloc();
|
||||||
|
|
||||||
Globals::docs.alloc();
|
Globals::docs.alloc();
|
||||||
Globals::load_path.alloc();
|
// Globals::load_path.alloc();
|
||||||
add_to_load_path(exe_path);
|
add_to_load_path(exe_path);
|
||||||
add_to_load_path("../bin/");
|
add_to_load_path("../bin/");
|
||||||
|
|
||||||
@@ -457,9 +462,6 @@ namespace Slime::Memory {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try load_built_ins_into_environment();
|
try load_built_ins_into_environment();
|
||||||
String file_name = Memory::create_string("pre.slime");
|
|
||||||
try built_in_load(file_name);
|
|
||||||
free(file_name.data);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user