Commit c47fc8f8 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼

avoid assertions due to uninitialized memory

parent 3e5c0074
......@@ -87,8 +87,6 @@ int io_init(struct io *io, const struct format_type *fmt, struct vlist *signals,
{
int ret;
assert(io->state == State::DESTROYED);
io->_vt = fmt;
io->_vd = new char[fmt->size];
......
......@@ -50,7 +50,6 @@ using namespace villas::utils;
int node_init(struct node *n, struct node_type *vt)
{
int ret;
assert(n->state == State::DESTROYED);
n->_vt = vt;
n->_vd = new char[vt->size];
......
......@@ -51,8 +51,6 @@ int node_direction_init(struct node_direction *nd, enum NodeDir dir, struct node
{
int ret;
assert(nd->state == State::DESTROYED);
nd->direction = dir;
nd->enabled = 1;
nd->vectorize = 1;
......
......@@ -116,8 +116,6 @@ int path_init(struct path *p)
{
int ret;
assert(p->state == State::DESTROYED);
new (&p->logger) Logger;
new (&p->received) std::bitset<MAX_SAMPLE_LENGTH>;
new (&p->mask) std::bitset<MAX_SAMPLE_LENGTH>;
......
......@@ -29,8 +29,6 @@ int pool_init(struct pool *p, size_t cnt, size_t blocksz, struct memory_type *m)
{
int ret;
assert(p->state == State::DESTROYED);
/* Make sure that we use a block size that is aligned to the size of a cache line */
p->alignment = kernel_get_cacheline_size();
p->blocksz = p->alignment * CEIL(blocksz, p->alignment);
......
......@@ -38,8 +38,6 @@
/** Initialize MPMC queue */
int queue_init(struct queue *q, size_t size, struct memory_type *m)
{
assert(q->state == State::DESTROYED);
/* Queue size must be 2 exponent */
if (!IS_POW2(size)) {
size_t old_size = size;
......@@ -63,8 +61,8 @@ int queue_init(struct queue *q, size_t size, struct memory_type *m)
#else
std::atomic_store_explicit(&q->tail, 0u, std::memory_order_relaxed);
std::atomic_store_explicit(&q->head, 0u, std::memory_order_relaxed);
#endif
q->state = State::INITIALIZED;
return 0;
......
Markdown is supported
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