Welcome to the Monastery | |
PerlMonks |
Re^3: Perl XS portable uint32_tby almut (Canon) |
on Jun 07, 2008 at 10:27 UTC ( [id://690823]=note: print w/replies, xml ) | Need Help?? |
I would rather not just compile in the & MASK32 if it is not needed. That's not what I was trying to say :) Rather, I meant to imply two things: (a) it might be easier to just do the 32-bit masking yourself, in case you can't easily figure out what the respective magic non-standard __I32_ulong__t incantation is to get the proper 32-bit type on that yet unknown weird 64-bit platform/compiler combo, (b) the performance penalty of doing so is not as big as one might expect. But you're right, the amount of masking statements actually required may be simplified (I must admit, I hadn't put too much thought into the details here). In particular, masking a, b, c centrally at the beginning of the macro, saves you from having to do so at the end of various other code paths that you do come along... Interestingly though, there's not much gain in performance from the reduced masking — I now get on average:
(under otherwise identical conditions) Anyhow, I tested your simplified code suggestion, and it's working fine (at least on x86_64-linux). Thanks for adding another useful module to CPAN!
In Section
Seekers of Perl Wisdom
|
|