Commit fe3413e1 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

list: do not check state during intialization

parent fc20afe0
......@@ -38,7 +38,6 @@
/** Static list initialization */
#define LIST_INIT_STATIC(l) \
__attribute__((constructor(105))) static void UNIQUE(__ctor)() {\
if ((l)->state == State::DESTROYED) \
vlist_init(l); \
} \
__attribute__((destructor(105))) static void UNIQUE(__dtor)() { \
......
......@@ -55,8 +55,6 @@ static int cmp_sort(const void *a, const void *b, void *thunk) {
int vlist_init(struct vlist *l)
{
assert(l->state == State::DESTROYED);
pthread_mutex_init(&l->lock, nullptr);
l->length = 0;
......
......@@ -42,7 +42,6 @@ TestSuite(list, .description = "List datastructure");
Test(list, vlist_lookup)
{
struct vlist l;
l.state = State::DESTROYED;
vlist_init(&l);
......@@ -67,7 +66,6 @@ Test(list, vlist_lookup)
Test(list, vlist_search)
{
struct vlist l;
l.state = State::DESTROYED;
vlist_init(&l);
......@@ -108,7 +106,6 @@ static int dtor(void *ptr)
Test(list, destructor)
{
struct vlist l;
l.state = State::DESTROYED;
struct content elm;
elm.destroyed = 0;
......@@ -128,7 +125,6 @@ Test(list, basics)
uintptr_t i;
int ret;
struct vlist l;
l.state = State::DESTROYED;
vlist_init(&l);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment