#include <string.h>
#include <urcu/uatomic.h>
-#include <common/defaults.h>
+#include <common/defaults.hpp>
-#include "snapshot.h"
-#include "utils.h"
+#include "snapshot.hpp"
+#include "utils.hpp"
/*
* Return the atomically incremented value of next_output_id.
struct snapshot_output *snapshot_output_alloc(void)
{
- return (snapshot_output *) zmalloc(sizeof(struct snapshot_output));
+ return zmalloc<snapshot_output>();
}
/*
LTTNG_ASSERT(snapshot);
LTTNG_ASSERT(name);
+ ASSERT_RCU_READ_LOCKED();
cds_lfht_for_each_entry(snapshot->output_ht->ht, &iter.iter, output,
node.node) {
struct snapshot_output *output = NULL;
LTTNG_ASSERT(snapshot);
+ ASSERT_RCU_READ_LOCKED();
lttng_ht_lookup(snapshot->output_ht, (void *)((unsigned long) id), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
DBG3("Snapshot output not found with id %" PRId32, id);
goto error;
}
- output = caa_container_of(node, struct snapshot_output, node);
+ output = lttng::utils::container_of(node, &snapshot_output::node);
error:
return output;
snapshot_output_destroy(output);
}
rcu_read_unlock();
- ht_cleanup_push(obj->output_ht);
+ lttng_ht_destroy(obj->output_ht);
}