The _X_t_C_a_l_l_o_c function allocates space for the specified number of array elements of the specified size and initializes the space to zero. If there is insufficient memory to allocate the new block, _X_t_C_a_l_l_o_c calls _X_t_E_r_r_o_r_M_s_g.
The _X_t_R_e_a_l_l_o_c function changes the size of a block of storage (possibly moving it). Then, it copies the old contents (or as much as will fit) into the new block and frees the old block. If there is insufficient memory to allocate the new block, _X_t_R_e_a_l_l_o_c calls _X_t_E_r_r_o_r_M_s_g. If ptr is NULL, _X_t_R_e_a_l_l_o_c allocates the new storage without copying the old contents; that is, it simply calls _X_t_M_a_l_l_o_c.
The _X_t_F_r_e_e function returns storage and allows it to be reused. If ptr is NULL, _X_t_F_r_e_e returns immediately.
_X_t_N_e_w returns a pointer to the allocated storage. If there is insufficient memory to allocate the new block, _X_t_N_e_w calls _X_t_E_r_r_o_r_M_s_g. _X_t_N_e_w is a convenience macro that calls _X_t_M_a_l_l_o_c with the following arguments specified:
((type *) XtMalloc((unsigned) sizeof(type))
_X_t_N_e_w_S_t_r_i_n_g returns a pointer to the allocated storage. If there is insufficient memory to allocate the new block, _X_t_N_e_w_S_t_r_i_n_g calls _X_t_E_r_r_o_r_M_s_g. _X_t_N_e_w_S_t_r_i_n_g is a convenience macro that calls _X_t_M_a_l_l_o_c with the following arguments specified:
(strcpy(XtMalloc((unsigned) strlen(str) + 1), str))