Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Perl XS binding to a struct with an array of chars*

by MaxPerl (Acolyte)
on Nov 20, 2022 at 16:58 UTC ( [id://11148275]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl XS binding to a struct with an array of chars*
in thread Perl XS binding to a struct with an array of chars*

sorry, some typos: "The only thing I don't understand is, why I had to reallocate count+2 items of char*. It should be count-1 :-S (because count starts at 1, and the index of the given Perl array starts at 0)..."

  • Comment on Re^3: Perl XS binding to a struct with an array of chars*

Replies are listed 'Best First'.
Re^4: Perl XS binding to a struct with an array of chars*
by syphilis (Archbishop) on Nov 21, 2022 at 01:07 UTC
    MaxPerl, I haven't managed to get my head around the exact requirements of the XS code, so I can't comment much more.
    I noticed in your original post that you had a DESTROY function, and I just wanted to add that I couldn't see any evidence that it will be called automagically.
    You may find that you have to explicitly call DESTROY (or Safefree) in your code, in order to avoid memory leaks.

    Cheers,
    Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-26 00:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found