Separated load_path init from loading pre.slime

This commit is contained in:
FelixBrendel
2020-03-26 20:30:06 +01:00
parent 4f0fef064e
commit 5371c63ec0
3 changed files with 11 additions and 6 deletions
+3 -1
View File
@@ -492,6 +492,7 @@ namespace Slime {
proc interprete_file (char* file_name) -> Lisp_Object* {
try Memory::init();
try Memory::load_pre();
Lisp_Object* result;
@@ -502,7 +503,8 @@ namespace Slime {
proc interprete_stdin() -> void {
try_void Memory::init();
try_void Memory::load_pre();
printf("Welcome to the lispy interpreter.\n%s\n", version_string);
char* line;
+1
View File
@@ -38,6 +38,7 @@ namespace Slime {
Environment* create_built_ins_environment();
Lisp_Object* create_lisp_object_cfunction(bool is_special);
void init();
void load_pre();
char* get_c_str(String);
void free_everything();
String create_string(const char*);
+7 -5
View File
@@ -128,7 +128,7 @@ namespace Slime::Memory {
// free the exe dir:
free(Globals::load_path.data[0]);
Globals::load_path.dealloc();
// Globals::load_path.dealloc();
Globals::docs.dealloc();
Globals::Current_Execution::envi_stack.dealloc();
Globals::Current_Execution::cs.dealloc();
@@ -171,6 +171,11 @@ namespace Slime::Memory {
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 {
profile_this();
@@ -199,7 +204,7 @@ namespace Slime::Memory {
Globals::Current_Execution::mes.alloc();
Globals::docs.alloc();
Globals::load_path.alloc();
// Globals::load_path.alloc();
add_to_load_path(exe_path);
add_to_load_path("../bin/");
@@ -457,9 +462,6 @@ namespace Slime::Memory {
};
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;
}