Ver código fonte

Disabled shutdown hook for now, UNICODE support for paths

banana-cakes
FelixBrendel 6 anos atrás
pai
commit
39dbfa3db9
4 arquivos alterados com 17 adições e 11 exclusões
  1. +1
    -1
      hashmap.hpp
  2. +7
    -7
      hooks.hpp
  3. +3
    -3
      test.cpp
  4. +6
    -0
      types.hpp

+ 1
- 1
hashmap.hpp Ver arquivo

@@ -131,7 +131,6 @@ struct Hash_Map {
/* count */
} else {
/* collision, check resize */
++cell_count;
if ((cell_count*1.0f / current_capacity) > 0.666f) {
auto old_data = data;
data = (HM_Cell*)calloc(current_capacity*4, sizeof(HM_Cell));
@@ -148,6 +147,7 @@ struct Hash_Map {
free(old_data);
index = hash_val % current_capacity;
}
++cell_count;
/* search for empty slot for new cell starting at desired index; */
/* preventing gotos using lambdas! */
[&]{


+ 7
- 7
hooks.hpp Ver arquivo

@@ -75,10 +75,10 @@ struct Hook : Array_List<Lambda<void()>> {
}
};

struct __System_Shutdown_Hook : Hook {
void operator()() = delete;
~__System_Shutdown_Hook() {
Hook::operator()();
dealloc();
}
} system_shutdown_hook;
// struct __System_Shutdown_Hook : Hook {
// void operator()() = delete;
// ~__System_Shutdown_Hook() {
// Hook::operator()();
// dealloc();
// }
// } system_shutdown_hook;

+ 3
- 3
test.cpp Ver arquivo

@@ -7,9 +7,9 @@
Hook h;
s32 main(s32 argc, char* argv[]) {
printf("Hello world");
system_shutdown_hook << [] {
printf("Goodbye world\n");
};
// system_shutdown_hook << [] {
// printf("Goodbye world\n");
// };

h << []{
printf("Hallo1");


+ 6
- 0
types.hpp Ver arquivo

@@ -14,3 +14,9 @@ typedef uint64_t u64;

typedef float f32;
typedef long double f64;

#ifdef UNICODE
typedef wchar_t path_char;
#else
typedef char path_char;
#endif

Carregando…
Cancelar
Salvar