in reply to Re: help with XS (Newx and
in thread help with XS (Newx and

Hi! sorry if I ask, but the
Newxz( l_packet, 1, AirLorconDriver);
would be referred to the memset or to the malloc function? because in the malloc case (r = (AirLorconDriver *) malloc(sizeof(AirLorconDriver *) );) there isn't any packet_l. thanks Edoardo Mantovani, 2020

Replies are listed 'Best First'.
Re^3: help with XS (Newx and
by Corion (Patriarch) on Sep 05, 2020 at 19:40 UTC

    Newxz is a combined malloc() plus memset() call, see perlapi and perlguts on it.

    I think the usage would be to declare the pointer to your struct and then to have it allocated and zeroed like this:

    Newxz( r, 1, AirLorconDriver );