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...
Pedigo asked 6/11, 2017 at 21:6

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...
Broadnax asked 16/1, 2018 at 9:19

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...
Minier asked 12/10, 2017 at 21:19

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...
Maitilde asked 10/10, 2017 at 13:3

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...
Hetman asked 26/8, 2017 at 14:24

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...
Anaplasty asked 6/3, 2017 at 15:50

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...
Forestay asked 15/12, 2016 at 21:42

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 ...
Upcast asked 1/6, 2016 at 23:29

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 ...
Confiscate asked 19/5, 2016 at 12:2

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...
Antisyphilitic asked 3/6, 2013 at 17:33

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)....
Parmesan asked 23/5, 2015 at 15:25

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...
Quathlamba asked 18/7, 2015 at 10:18

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)....
Franconian asked 10/6, 2015 at 17:6

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...
Manatarms asked 11/4, 2014 at 15:37

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...
Adenectomy asked 5/6, 2013 at 8:59

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...
Windup asked 13/5, 2013 at 17:33

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...
Georganngeorge asked 19/4, 2013 at 6:4

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...
Haynie asked 4/10, 2012 at 14:29

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...
Intonate asked 13/9, 2012 at 9:57

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

© 2022 - 2024 — McMap. All rights reserved.