RE: dPERINTERP/MY_CXT (was: speeding up XS_DBI_dispatch())

"Jan Dubois" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Organization ActiveState Software Inc
Message-ID <[email protected]>
On Fri, 17 Feb 2012, Dave Mitchell wrote:
> On Fri, Feb 10, 2012 at 10:03:06AM -0800, Jan Dubois wrote:
>> On Fri, 10 Feb 2012, Tim Bunce wrote:
>>> On Fri, Feb 10, 2012 at 03:27:24PM +0000, Dave Mitchell wrote:
>>>> If anyone knows of a more elegant way to make a function from
>>>> DBI.xs available to DBD:: code, please let me know!
>>>
>>> I hope to take a proper look in the next day or so.
>>
>> The "standard" way nowadays seems to be to use ExtUtils::Depends. I'm
>> not convinced though that it is any more elegant than the method you
>> are already using.
>>
>> An example module using ExtUtils::Depends is B::Hooks::OP::Check.
>>
>> It is important to also list all exported functions in the FUNCLIST
>> parameter to MakeMaker; otherwise the symbols will not be exported on
>> AIX and Windows.
>
> Is this necessary for my patch?

No, it isn't.

> I assumed that just by treating my function as XS (i.e. by calling
> newXS), something magical would happen somehow. After all, none of the
> other XS functions need a special mention in Makefile.PL?

None of the XS functions are actually exposed to the linker, except for
the boot_* symbol, which is already treated specially by MakeMaker.

All other XS symbols are only accessed via the CV and not via the
linker/loader symbol tables.

Adding to FUNCLIST is necessary if you want to export the symbol
at the C level and have it resolved by the OS loader.

Cheers,
-Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.