in reply to Re: XS: Converting a data structure in a string
in thread XS: Converting a data structure in a string
There's a conceptual flaw in your sub. The splice would increase the number of elements in the array, but your alen variable isn't going up, so there will be a number of elements you never get to.The original perl function already works as you wrote. My XS is only a "sketch" version now and does not handle this "problem".
Is there a possibility that the data structure will be more than two levels deep? If so, you'll need a recursive function.
As you noted, this is not necessary.
The recursive solution was our first perl version. Then I wrote a non-recursive version that cuts down stack usage by a good factor. This is the actual function that I want to rewrite in XS.
You're going to need to take a look at the perlcall docs
Thanks for your suggestion.
|
|---|