static void fd_handle_release(struct urcu_ref *ref)
{
int ret;
- struct fd_handle *handle = container_of(ref, struct fd_handle, ref);
+ struct fd_handle *handle = lttng::utils::container_of(ref, &fd_handle::ref);
LTTNG_ASSERT(handle->fd >= 0);
ret = close(handle->fd);
goto end;
}
- handle = (fd_handle *) zmalloc(sizeof(*handle));
+ handle = zmalloc<fd_handle>();
if (!handle) {
PERROR("Failed to allocate fd_handle");
goto end;