summaryrefslogtreecommitdiff
path: root/XSUB.h
Commit message (Collapse)AuthorAgeFilesLines
* XSUB.h - line up properlyYves Orton2022-12-301-9/+9
| | | | and make sure they are shorter than 80 cols
* XSUB.h - put STMT_END on its own line and lined up with STMT_STARTYves Orton2022-09-071-2/+3
|
* Change autodoc flagKarl Williamson2022-06-141-14/+14
| | | | | | This should be being used only in core, as its only use is for autodoc. Change the flag name to be more mnemonic, freeing up its current name for another use.
* Remove NetWare supportDagfinn Ilmari Mannsåker2021-10-081-39/+0
| | | | The build has been broken since 2009.
* replace all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITYTomasz Konojacki2021-06-091-1/+1
| | | | | | | | | | | | Since the removal of PERL_OBJECT (acfe0abcedaf592fb4b9cb69ce3468308ae99d91) PERL_IMPLICIT_CONTEXT and MULTIPLICITY have been synonymous and they're being used interchangeably. To simplify the code, this commit replaces all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITY. PERL_IMPLICIT_CONTEXT will stay defined for compatibility with XS modules.
* Base *.[ch] files: Replace leading tabs with blanksMichael G Schwern2021-05-311-56/+56
| | | | | | | This is a rebasing by @khw of part of GH #18792, which I needed to get in now to proceed with other commits. It also strips trailing white space from the affected files.
* Use perl.h versions of PERL_UNUSED_foo in XSUB.hKarl Williamson2021-01-031-2/+2
| | | | | | | | | | | | This commit was applied to perl.h, but not to XSUB.h: commit a730e3f230f364cffe49370f816f975ae7c9c403 Author: Jarkko Hietaniemi <jhi@iki.fi> Date: Thu Sep 4 09:08:33 2014 -0400 Use sizeof() in UNUSED_ARG and UNUSED_VAR to avoid accessing the values. The values might even be uninitialized in the case of PERL_UNUSED_VAR.
* autodoc.pl: Enhance apidoc_section featureKarl Williamson2020-11-061-3/+3
| | | | | | | | | | | This feature allows documentation destined for perlapi or perlintern to be split into sections of related functions, no matter where the documentation source is. Prior to this commit the line had to contain the exact text of the title of the section. Now it can be a $variable name that autodoc.pl expands to the title. It still has to be an exact match for the variable in autodoc, but now, the expanded text can be changed in autodoc alone, without other files needing to be updated at the same time.
* XSUB.h: Fix some apidoc entriesKarl Williamson2020-11-021-7/+15
| | | | So that Devel::PPPort can test that they compile
* perlapi: Add a link to xsubppKarl Williamson2020-11-021-0/+2
|
* Document XSPROTOKarl Williamson2020-10-061-0/+4
|
* perlapi: XS_EXTERNAL is preferred over plain XSKarl Williamson2020-09-051-1/+2
|
* perlapi: XS, XS_EXTERNAL do take a parameterKarl Williamson2020-09-051-2/+2
|
* Reorganize perlapiKarl Williamson2020-09-041-3/+1
| | | | | This uses a new organization of sections that I came up with. I asked for comments on p5p, but there were none.
* Change some =head1 to apidoc_section linesKarl Williamson2020-09-041-2/+2
| | | | | apidoc_section is slightly favored over head1, as it is known only to autodoc, and can't be confused with real pod.
* XSUB.h: fix MARK and items variables inside BOOT XSUBsTomasz Konojacki2020-08-031-3/+3
| | | | | | | ax was incremented by Perl_xs_handshake() and because of that MARK and items were off by one inside BOOT XSUBs. fixes #17755
* Remove PERL_GLOBAL_STRUCTDagfinn Ilmari Mannsåker2020-07-201-2/+0
| | | | | | | | This was originally added for MinGW, which no longer needs it, and only still used by Symbian, which is now removed. This also leaves perlapi.[ch] empty, but we keep the header for CPAN backwards compatibility.
* Remove Symbian portDagfinn Ilmari Mannsåker2020-07-201-3/+0
| | | | | Also eliminate USE_HEAP_INSTEAD_OF_STACK and SETSOCKOPT_OPTION_VALUE_T, since Symbian was the only user of those.
* perlapi: Document XST_mUVKarl Williamson2019-09-021-0/+4
| | | | This one was missing from the set
* Fix apidoc macro entriesKarl Williamson2019-06-251-7/+7
| | | | | | | | | | This makes various fixes to the text that is used to generate the documentation. The dominant change is to add the 'n' flag to indicate that the macro takes no arguments. A couple should have been marked with a D (for deprecated) flag, and a couple were missing parameters, and a couple were missing return values. These were spotted by using Devel::PPPort on them.
* Add 'n' flag to various =for apidoc linesKarl Williamson2019-05-301-14/+14
| | | | | | This indicates to not output the macro with parentheses for parameters. Currently that doesn't happen anyway, but a future commit will change things so this is required (so that a bug can be fixed)
* Define also Perl's calloc() macroPali2018-10-291-0/+1
| | | | | | | | | Functions malloc(), realloc() and free() are already redefined to PerlMem_malloc(), PerlMem_realloc() and PerlMem_free(). But calloc() not. This leads to the problem that memory by calloc() is allocated by system C library, but freed by Perl's PerlMem_free() which just cause memory corruptions.
* XSUB.h: simplify cpp conditions using C89 "#elif"Aaron Crane2017-10-211-16/+10
|
* Use new paradigm for hdr file double inclusion guardKarl Williamson2017-06-021-3/+3
| | | | | | | | | | We changed to use symbols not likely to be used by non-Perl code that could conflict, and which have trailing underbars, so they don't look like a regular Perl #define. See https://rt.perl.org/Ticket/Display.html?id=131110 There are many more header files which are not guarded.
* Avoid unused-parameter warning when compiling with g++.James E Keenan2017-06-011-1/+1
|
* Remove support for Splint static source code analyzerAndy Lester2016-11-301-16/+5
| | | | | | | | | | | | Splint has not been updated since 2007 and doesn’t even build for me. As far as I know, I'm the only person who's ever worked with Splint on Perl 5. Here's what changes: * Makefile target "splint" * Macros in XSUB.h and perl.h * Support in regen/embed.pl
* add assertion to prevent stack corruption in XSUBDoug Bell2015-10-021-0/+1
| | | | | We should not be able to return negative offsets from the stack in XSUBs.
* Various pods: Add C<> around many typed-as-is thingsKarl Williamson2015-09-031-5/+5
| | | | Removes 'the' in front of parameter names in some instances.
* perlapi, perlintern: Add L<> links to podKarl Williamson2015-09-031-3/+5
|
* Replace common Emacs file-local variables with dir-localsDagfinn Ilmari Mannsåker2015-03-221-6/+0
| | | | | | | | | | | | | | | | An empty cpan/.dir-locals.el stops Emacs using the core defaults for code imported from CPAN. Committer's work: To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed to be incremented in many files, including throughout dist/PathTools. perldelta entry for module updates. Add two Emacs control files to MANIFEST; re-sort MANIFEST. For: RT #124119.
* SvREFCNT_dec_NN in SDBMDaniel Dragan2014-12-111-1/+1
| | | | | VC 2003 optimizer didn't catch it because SvREFCNT_dec is rarely inlined on -O1
* add filename handling to xs handshakeDaniel Dragan2014-11-131-16/+44
| | | | | | | | | | | | | | | | | | | | | - this improves the error message on ABI incompatibility, per [perl #123136] - reduce the number of gv_fetchfile calls in newXS over registering many XSUBs - "v" was not stripped from PERL_API_VERSION_STRING since string "vX.XX.X\0", a typical version number is 8 bytes long, and aligned to 4/8 by most compilers in an image. A double digit maint release is extremely unlikely. - newXS_deffile saves on machine code in bootstrap functions by not passing arg filename - move newXS to where the rest of the newXS*()s live - move the "no address" panic closer to the start to get it out of the way sooner flow wise (it nothing to do with var gv or cv) - move CvANON_on to not check var name twice - change die message to use %p, more efficient on 32 ptr/64 IV platforms see ML post "about commit "util.c: fix comiler warnings"" - vars cv/xs_spp (stack pointer pointer)/xs_interp exist for inspection by a C debugger in an unoptimized build
* add xs_handshake APIDaniel Dragan2014-11-071-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API elevates the amount of ABI compatibility protection between XS modules and the interp. It also makes each boot XSUB smaller in machine code by removing function calls and factoring out code into the new Perl_xs_handshake and Perl_xs_epilog functions. sv.c : - revise padlist duping code to reduce code bloat/asserts on DEBUGGING ext/DynaLoader/dlutils.c : - disable version checking so interp startup is faster, ABI mismatches are impossible because DynaLoader is never available as a shared library ext/XS-APItest/XSUB-redefined-macros.xs : - "" means dont check the version, so switch to " " to make the test in xsub_h.t pass, see ML thread "XS_APIVERSION_BOOTCHECK and XS_VERSION is CPP defined but "", mow what?" ext/re/re.xs : - disable API version checking until #123007 is resolved ParseXS/Utilities.pm : 109-standard_XS_defs.t : - remove context from S_croak_xs_usage similar to core commit cb077ed296 . CvGV doesn't need a context until 5.21.4 and commit ae77754ae2 and by then core's croak_xs_uage API has been long available and this backport doesn't need to account for newer perls - fix test where lack of having PERL_IMPLICIT_CONTEXT caused it to fail
* simplify Perl_xs_apiversion_bootcheckDaniel Dragan2014-11-061-1/+1
| | | | | | | We control both strings. Perl API versions are not old decimal or alphas versions. Maints dont increase Perl API ver. Just do a memcmp. Faster and less machine code. Before 0xA6 bytes of machine code on VC 2003 32b, after 0x35. This patch is related to [perl #123136].
* perlapi: Refactor placements, headings of some functionsKarl Williamson2014-06-051-2/+2
| | | | | | | | | | | | | | It is not very user friendly to list functions as "Functions found in file FOO". Better is to group them by purpose, as many were already. I went through and placed the ones that weren't already so grouped into groups. Patches welcome if you have a better classification. I changed the headings of some so that the important disctinction was the first word so that they are placed in the file more appropriately. And a couple of ones that I had created myself, I came up with a name that I think is better than the original
* perlapi: Consistent spaces after dotsFather Chrysostomos2013-12-291-5/+5
| | | | plus some typo fixes. I probably changed some things in perlintern, too.
* Remove option to build without USE_SOCKETS_AS_HANDLES on WindowsSteve Hay2012-09-281-12/+10
| | | | | | | | | The option is always defined by default and can't be disabled from the makefiles. Manually disabling it causes several tests to fail, which nobody has reported, so we presume nobody does this. The non-default configuration is believed to be historical cruft with no value now, and has clearly bitrotted in recent years (hence the test failures), so remove it to simplify the codebase slightly.
* Omnibus removal of register declarationsKarl Williamson2012-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes most register declarations in C code (and accompanying documentation) in the Perl core. Retained are those in the ext directory, Configure, and those that are associated with assembly language. See: http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c which says, in part: There is no good example of register usage when using modern compilers (read: last 10+ years) because it almost never does any good and can do some bad. When you use register, you are telling the compiler "I know how to optimize my code better than you do" which is almost never the case. One of three things can happen when you use register: The compiler ignores it, this is most likely. In this case the only harm is that you cannot take the address of the variable in the code. The compiler honors your request and as a result the code runs slower. The compiler honors your request and the code runs faster, this is the least likely scenario. Even if one compiler produces better code when you use register, there is no reason to believe another will do the same. If you have some critical code that the compiler is not optimizing well enough your best bet is probably to use assembler for that part anyway but of course do the appropriate profiling to verify the generated code is really a problem first.
* update the editor hints for spaces, not tabsRicardo Signes2012-05-291-2/+2
| | | | | This updates the editor hints in our files for Emacs and vim to request that tabs be inserted as spaces.
* static and dllexport don't belong together on cygwinTony Cook2011-12-011-1/+1
| | | | | | This was causing build errors like: Cwd.c:553:1: error: external linkage required for symbol ‘XS_Cwd_getcwd’ because of ‘dllexport’ attribute
* Revert back to making XS(name) expose XSUB symbolsSteffen Mueller2011-08-281-5/+5
| | | | | | | Instead, as Zefram recommended, ExtUtils::ParseXS will be patched to not export XSUB symbols by default that are generated through the module itself. As Zefram said, this has the advantage of allowing older perls to benefit from the non-exporting of symbols.
* Fix C++ build following commit ab1478f7146843f7.Nicholas Clark2011-08-211-1/+1
| | | | | | For C++, ab1478f7146843f7 inadvertently defined XS_INTERNAL as extern "C" static ... which C++ compilers rightfully choke on.
* Make XSUBs static by defaultSteffen Mueller2011-08-211-22/+15
| | | | | | | At the same time, do not include "STATIC" in XSPROTO and get rid of the XSPROTO_INTERNAL and XSPROTO_EXTERNAL macros because of that. This allows Devel::PPPort to continue doing its evil typedef'ing magic using XSPROTO.
* API to explicitly select to export XSUB symbols or notSteffen Mueller2011-08-111-7/+41
| | | | | | | | | | | | This adds a few additional macros to XSUB.h: XS_INTERNAL and XS_EXTERNAL are versions of the XS macro that explicitly use internal (static) linking or not. XSPROTO_INTERNAL and XSPROTO_EXTERNAL are the obvious equivalents for XSPROTO (which is apparently not public yet we support its use in SWIG...). The XS and XSPROTO macros themselves are not defined to not use STATIC, but this may (should?) be changed in the future.
* Abolish PL_vtbl_sig. It's been all 0s since it was added in 5.0 alpha 2.Nicholas Clark2011-06-111-1/+0
| | | | | Magic with a NULL vtable is equivalent to magic with a vtable of all 0s. On CPAN, only Apache::Peek's code for 5.005 is referencing it.
* Fix typos (spelling errors) in Perl sources.Peter J. Acklam) (via RT2011-01-071-1/+1
| | | | | | | | | # New Ticket Created by (Peter J. Acklam) # Please include the string: [perl #81904] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81904 > Signed-off-by: Abigail <abigail@abigail.be>
* Convert the implementation of XS_APIVERSION_BOOTCHECK to a function.Nicholas Clark2010-10-081-18/+1
| | | | | | The previous macro generated over .5K of object code. This is in every shared object, and is only called once. Hence this change increases the perl binary by about .5K (once), to save .5K for every XS module loaded.
* Convert the implementation of XS_VERSION_BOOTCHECK to a function from a macro.Nicholas Clark2010-10-071-37/+1
| | | | | | The macro expansion generates over 1K of object code. This is in every shared object, and is only called once. Hence this change increases the perl binary by about 1K (once), to save 1K for every XS module loaded.
* In XS_VERSION_BOOTCHECK, correct the flags argument of get_sv() to 0.Nicholas Clark2010-09-021-2/+2
| | | | It should not be FALSE, because it's a bitmap, not a boolean.
* Check API compatibility when loading xs modulesFlorian Ragwitz2010-07-261-3/+27
| | | | | | | | | | | | | This adds PL_apiversion, allowing the API version of a running interpreter to be introspected. It is used in the new XS_APIVERSION_BOOTCHECK macro, which is added to the _boot function of every XS module, to compare it against the API version the module has been compiled against. If the versions do not match, an exception is thrown. This doesn't fully prevent binary incompatible extensions to be loaded. It merely compares PERL_API_* between compile- and runtime, and does not attempt to solve the problem of identifying binary incompatible perls with the same API version (i.e. the same perl version configured with and without DEBUGGING).