struct lttng_userspace_probe_location_lookup_method *ret = NULL;
struct lttng_userspace_probe_location_lookup_method_elf *elf_method;
- elf_method = (lttng_userspace_probe_location_lookup_method_elf *) zmalloc(sizeof(*elf_method));
+ elf_method = zmalloc<lttng_userspace_probe_location_lookup_method_elf>();
if (!elf_method) {
PERROR("zmalloc");
goto end;
struct lttng_userspace_probe_location_lookup_method *ret = NULL;
struct lttng_userspace_probe_location_lookup_method_sdt *sdt_method;
- sdt_method = (lttng_userspace_probe_location_lookup_method_sdt *) zmalloc(sizeof(*sdt_method));
+ sdt_method = zmalloc<lttng_userspace_probe_location_lookup_method_sdt>();
if (!sdt_method) {
PERROR("zmalloc");
goto end;
goto error;
}
- location = (lttng_userspace_probe_location_function *) zmalloc(sizeof(*location));
+ location = zmalloc<lttng_userspace_probe_location_function>();
if (!location) {
PERROR("Error allocating userspace probe location");
goto error;
goto error;
}
- location = (lttng_userspace_probe_location_tracepoint *) zmalloc(sizeof(*location));
+ location = zmalloc<lttng_userspace_probe_location_tracepoint>();
if (!location) {
PERROR("zmalloc");
goto error;
LTTNG_ASSERT(lookup_method->type ==
LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF);
- elf_method = (lttng_userspace_probe_location_lookup_method_elf *) zmalloc(sizeof(*elf_method));
+ elf_method = zmalloc<lttng_userspace_probe_location_lookup_method_elf>();
if (!elf_method) {
PERROR("Error allocating ELF userspace probe lookup method");
goto error;
LTTNG_ASSERT(lookup_method->type ==
LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_TRACEPOINT_SDT);
- sdt_method = (lttng_userspace_probe_location_lookup_method_sdt *) zmalloc(sizeof(*sdt_method));
+ sdt_method = zmalloc<lttng_userspace_probe_location_lookup_method_sdt>();
if (!sdt_method) {
PERROR("zmalloc");
goto error;