strcpy (user, "?");
/* Find CPU cores used by the process. */
- cores = (int *) xcalloc (num_cores, sizeof (int));
+ cores = XCNEWVEC (int, num_cores);
task_count = get_cores_used_by_process (pid, cores, num_cores);
cores_str = (char *) xcalloc (task_count, sizeof ("4294967295") + 1);
{
struct dirent *dp;
const size_t list_block_size = 512;
- PID_T *process_list = (PID_T *) xmalloc (list_block_size * 2 * sizeof (PID_T));
+ PID_T *process_list = XNEWVEC (PID_T, list_block_size * 2);
size_t process_count = 0;
size_t i;