LTTNG_ASSERT(regp);
- reg = (buffer_reg_uid *) zmalloc(sizeof(*reg));
+ reg = zmalloc<buffer_reg_uid>();
if (!reg) {
PERROR("zmalloc buffer registry uid");
ret = -ENOMEM;
goto error;
}
- reg->registry = (buffer_reg_session *) zmalloc(sizeof(struct buffer_reg_session));
+ reg->registry = zmalloc<buffer_reg_session>();
if (!reg->registry) {
PERROR("zmalloc buffer registry uid session");
ret = -ENOMEM;
LTTNG_ASSERT(regp);
- reg = (buffer_reg_pid *) zmalloc(sizeof(*reg));
+ reg = zmalloc<buffer_reg_pid>();
if (!reg) {
PERROR("zmalloc buffer registry pid");
ret = -ENOMEM;
goto error;
}
- reg->registry = (buffer_reg_session *) zmalloc(sizeof(struct buffer_reg_session));
+ reg->registry = zmalloc<buffer_reg_session>();
if (!reg->registry) {
PERROR("zmalloc buffer registry pid session");
ret = -ENOMEM;
DBG3("Buffer registry channel create with key: %" PRIu64, key);
- reg = (buffer_reg_channel *) zmalloc(sizeof(*reg));
+ reg = zmalloc<buffer_reg_channel>();
if (!reg) {
PERROR("zmalloc buffer registry channel");
return -ENOMEM;
DBG3("Buffer registry creating stream");
- reg = (buffer_reg_stream *) zmalloc(sizeof(*reg));
+ reg = zmalloc<buffer_reg_stream>();
if (!reg) {
PERROR("zmalloc buffer registry stream");
return -ENOMEM;