Ver código fonte

We compiling again after including the type into the flags field

master
FelixBrendel 7 anos atrás
pai
commit
903d9bdd8c
3 arquivos alterados com 11 adições e 12 exclusões
  1. +6
    -8
      src/main.cpp
  2. +3
    -2
      src/memory.cpp
  3. +2
    -2
      src/slime.h

+ 6
- 8
src/main.cpp Ver arquivo

@@ -1,19 +1,17 @@
#include "slime.h"

// using namespace Slime;

int main(int argc, char* argv[]) {
if (argc > 1) {
if (string_equal(argv[1], "--run-tests")) {
return run_all_tests() ? 0 : 1;
if (Slime::string_equal(argv[1], "--run-tests")) {
return Slime::run_all_tests() ? 0 : 1;
}

interprete_file(argv[1]);
if (Globals::error) {
log_error();
Slime::interprete_file(argv[1]);
if (Slime::Globals::error) {
Slime::log_error();
return 1;
}
} else {
interprete_stdin();
Slime::interprete_stdin();
}
}

+ 3
- 2
src/memory.cpp Ver arquivo

@@ -53,14 +53,14 @@ namespace Memory {

inline proc get_type(Lisp_Object* node) -> Lisp_Object_Type {
// the type is in the bits 0 to 5 (including)
return (Lisp_Object_Type) ((u64)node->flags & (u64)0xffffff);
return (Lisp_Object_Type) ((u64)node->flags & (u64)0b11111);
}


inline proc set_type(Lisp_Object* node, Lisp_Object_Type type) {
// the type is in the bits 0 to 5 (including)
u64 bitmask = (u64)-1;
bitmask -= 0xffffff;
bitmask -= 0b11111;
bitmask += (u64) type;
node->flags = (u64)(node->flags) | bitmask;
}
@@ -132,6 +132,7 @@ namespace Memory {
index = free_spots_in_object_memory->data[free_spots_in_object_memory->next_index--];
}
Lisp_Object* object = object_memory+index;
object->flags = 0;
object->sourceCodeLocation = nullptr;
object->userType = nullptr;
return object;


+ 2
- 2
src/slime.h Ver arquivo

@@ -12,7 +12,7 @@
#undef _CRT_SECURE_NO_DEPRECATE
#undef _CRT_SECURE_NO_WARNINGS

// namespace Slime {
namespace Slime {
# include "./defines.cpp"
# include "./structs.cpp"
# include "./forward_decls.cpp"
@@ -26,4 +26,4 @@
# include "./built_ins.cpp"
# include "./testing.cpp"
# include "./undefines.cpp"
// }
}

Carregando…
Cancelar
Salvar