uint64_t nb_allocated_indexes;
};
+namespace {
struct lttng_index {
uint64_t index;
struct cds_list_head head;
};
+} /* namespace */
struct lttng_index_allocator *lttng_index_allocator_create(
uint64_t index_count)
{
struct lttng_index_allocator *allocator = NULL;
- allocator = (lttng_index_allocator *) zmalloc(sizeof(*allocator));
+ allocator = zmalloc<lttng_index_allocator>();
if (!allocator) {
PERROR("Failed to allocate index allocator");
goto end;
LTTNG_ASSERT(idx < allocator->size);
- index = (lttng_index *) zmalloc(sizeof(*index));
+ index = zmalloc<lttng_index>();
if (!index) {
PERROR("Failed to allocate free index queue");
status = LTTNG_INDEX_ALLOCATOR_STATUS_ERROR;