Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: help with XS (Newx and

by Bpl (Scribe)
on Sep 05, 2020 at 19:23 UTC ( [id://11121383]=note: print w/replies, xml ) Need Help??


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 );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11121383]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-19 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found