xs Questions
1
I have a small Perl program. The program loads a module. The module loads an .so file with XSLoader. This Perl runs on Linux and is built with gcc and -DDEBUGGING, and subsequently so is the .so fi...
Gerfen asked 1/6, 2018 at 12:33
1
Solved
I am learning how to call C++ code from Perl and to start I am trying to create a basic C++ object from a Perl script.
To do this, I started by executing the h2xs command:
h2xs -A -nMyClass
Then...
1
Solved
When dumping perl SV with Devel::Peek I can see:
SV = IV(0x1c13168) at 0x1c13178
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 2
But can not find the description what pIOK mean.
I tried to look it at D...
2
Disclaimer I'm not sure I'm using the right terms. It may not be the optree responsible for the bloat mentioned below: it may be the symbols loaded by DynaLoader that are not freed.
Is it possible...
Triturable asked 13/10, 2017 at 21:27
1
Solved
Using XS i am trying to pass values from a C array into a Perl array that can be used in the script.
Here is the code from my xs file:
AV *
DoubleArray::getPerlArray()
CODE:
r = newAV();
for(s...
1
Solved
In my XS file I have:
As my new method:
matrix *
matrix::new( size_t ncols, size_t nrows )
which returns a matrix object like it should and I can invoke methods.
Then I have a method call whic...
3
Solved
I want to embed Perl in a c++ application and am looking for a method to call into c++ from perl via newXS(). Apart from the function pointer I need the associate a custom pointer to the CV created...
1
Solved
I am writing an XS module. I allocate some resource (e.g. malloc() or SvREFCNT_inc()) then do some operations involving the Perl API, then free the resource. This is fine in normal C because C has ...
Verified asked 20/8, 2017 at 17:31
3
In perl special tokens like __PACKAGE__, __SUB__, __FILE__, __LINE__ exists and available from script.
I may get value of __PACKAGE__ from XS as HvNAME( PL_currstash ), I suppose.
But how to acces...
2
Solved
Reading the perlxs documentation, I came to the section on the OUTPUT keyword:
xsubpp emits an automatic SvSETMAGIC() for all parameters in the
OUTPUT section of the XSUB, except RETVAL. This i...
1
Solved
A lot of Perl XS code uses const char * as the return value of an XS sub but never just char *. For example:
const char *
version(...)
CODE:
RETVAL = chromaprint_get_version();
OUTPUT: RETVAL
...
2
Solved
I'm looking for a data structure which should preferably perform equal O(1)? for any number of elements when adding/removing/retrieving elements.
Here are some additional guidelines,
retrieving ...
2
I have a 64-bit CentOS 6 system running a custom-built version of Perl 5.12.5, that is build for 32-bits. (Alas, this is because we are using the same RPMs for 32-bit and 64-bit systems.)
When I b...
1
Solved
I'm looking to play with perl parser manipulation. It looks like the various B::Hooks modules are what people use. I was wondering:
Best place to start for someone who has no XS experience (yet)....
3
I want to port a C function using 64 bits integers to Perl code. To do that, I use Perl XS.
My problem is there are no 64 bits integers in Perl XS types (only U32, U16 and U8).
So, what is the be...
1
Solved
How I could create SV value from null terminated string without copy? Like newSVpv(const char*, STRLEN) but without copy and with moving ownership to Perl (so Perl must release that string memory)....
1
Solved
I need to call a perl routine in my C program. The perl routine takes the following arguments: $a, $b, $c, where $a and $b are integers, $c is a string (may contain binary characters). According to...
1
Solved
Unable to find where the memory leak is happening in this code.
Basically I want to write a XS wrapper for a C-function which returns a two-dimensional array.
C-function:
int CW_returnArray(doub...
Argumentum asked 15/8, 2013 at 19:8
1
Solved
I am rather an XS beginner and I am looking into changing an existing XS module which uses a 15+ year old underlying C library heavily (in fact the module is basically just glue to this library). T...
2
Solved
I'm trying to understand some XS code that I inherited. I've been trying to add comments to a section that invokes Perl magic stuff, but I can't find any documentation to help me understand this li...
1
Solved
I have a complex encoding function in Pure Perl which I am converting to XS in the hope of gaining a performance boost.
The function I am converting to XS needs to recursively call itself. I can s...
1
Solved
Question
How can I support autovivified filehandle arguments in an XS function?
I'm XS-wrapping a C function which returns a file descriptor, and I'd like to present that file descriptor as a per...
Cretin asked 21/12, 2012 at 20:20
2
Solved
I am trying to write some XS code that exposes pieces a library to
Perl code as a stream interface that can be written to. The
get_stream function below is supposed to be a constructor that
prepare...
2
Solved
I have the below sample program which pushes the arguments to Perl stack and then calls "eval_sv". The sample perl statements get executed but i'm not able to retrieve the variables passe...
2
Solved
I'm working on some code that needs to serialize Perl regexes, including any regex flags. Only a subset of flags are supported, so I need to detect when unsupported flags like /u are in the regex o...
Ingenuity asked 7/8, 2012 at 17:46
1 Next >
© 2022 - 2024 — McMap. All rights reserved.