From ea2a3e6f166833f06f52a295e98aaa91f64cc28f Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Mon, 1 Jun 2020 00:36:34 -0700 Subject: [PATCH] [kutil] Remove ctor workaround in slab_allocated Before global constructors were working, I had added a hack to zero out the static vector member of in `slab_allocated`. Now that they are working, this can be removed. --- src/libraries/kutil/include/kutil/slab_allocated.h | 5 ----- src/libraries/kutil/vm_space.cpp | 3 --- 2 files changed, 8 deletions(-) diff --git a/src/libraries/kutil/include/kutil/slab_allocated.h b/src/libraries/kutil/include/kutil/slab_allocated.h index d0be1d6..89afec0 100644 --- a/src/libraries/kutil/include/kutil/slab_allocated.h +++ b/src/libraries/kutil/include/kutil/slab_allocated.h @@ -25,11 +25,6 @@ public: void operator delete(void *p) { s_free.append(reinterpret_cast(p)); } - // TODO: get rid of this terribleness - static void hacky_init_remove_me() { - memset(&s_free, 0, sizeof(s_free)); - } - private: static void allocate_chunk() { diff --git a/src/libraries/kutil/vm_space.cpp b/src/libraries/kutil/vm_space.cpp index a4a996c..eecc82b 100644 --- a/src/libraries/kutil/vm_space.cpp +++ b/src/libraries/kutil/vm_space.cpp @@ -12,9 +12,6 @@ DEFINE_SLAB_ALLOCATOR(node_type, 1); vm_space::vm_space(uintptr_t start, size_t size) { - // TODO: replace this with real global ctor - slab_allocated::hacky_init_remove_me(); - node_type *node = new node_type; node->address = start; node->size = size;