Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
and I wish you had pointed it out sooner :-)

I wish I'd noticed it earlier :) It was only by comparing your Inline C to the XS that it stood out. Previously I'd just checked that allocs and frees were being done with XS macros and not crt functions.

Thanks again for your help.

It's unclear to me how 'len' gets assigned the appropriate value for when it's needed

I wondered that too, but if you unwind the SvPV() macro, you eventually realise that the len parameter passed to it is not used to indicate the length of anything, but rather is used to retrieve the length of the data held in the SV. This is done using the SvCUR() macro. It takes a bit of unwinding and could probably bear a mention in perlapi.

I've updated GD.xs 2.30 locally with this and got rid of a few unused var warnings which allowed it to compile clean and pass it's test suit. I then thrashed it for a while calling the OP sub and another like it that used GD2 data in a loop and it seems fine.

I've generated a patch against 2.30 and sent it directly to L.Stein along with a warning that I don't really know what I am doing with this stuff.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^12: Segfault on second (identical) call to a sub by BrowserUk
in thread Segfault on second (identical) call to a sub by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-03-28 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found