1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

avoid assertions due to uninitialized memory

This commit is contained in:
Steffen Vogel 2020-03-10 23:25:23 +01:00
parent 3e5c0074e2
commit c47fc8f865
6 changed files with 1 additions and 12 deletions

View file

@ -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];

View file

@ -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];

View file

@ -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;

View file

@ -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>;

View file

@ -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);

View file

@ -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;