summaryrefslogtreecommitdiff
path: root/XSUB.h
Commit message (Collapse)AuthorAgeFilesLines
* 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).
* Fix leaks in XS_VERSION_BOOTCHECKFlorian Ragwitz2010-07-221-11/+23
| | | | | | | | | The SV holding XS_VERSION, and the version object created from it were leaked. Also, if the version from perl space wasn't a version object already, the one that got created leaked. Additionally, in case of an error, the two SVs returned by vstringify were leaked.
* The UNDERBAR macro should use find_rundefsv() as wellVincent Pit2010-06-031-6/+5
|
* XSUB.h is supposed to redefine fgets under PERL_IMPLICIT_SYS, but doesn't.Jan Dubois2010-04-211-0/+1
| | | | | See also http://rt.cpan.org/Public/Bug/Display.html?id=55049 with workaround in http://code.google.com/p/perl-devel-nytprof/source/detail?r=1168
* Add mingw64 supportSisyphus2009-11-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi, Using the attached patch to the blead source (as of a few hours ago), I can build perl with the following OS/compiler/make combos. On 32-bit XP: MSVC++ 7.0 / dmake (uses win32/makefile.mk) MSVC++ 7.0 / nmake (uses win32/Makefile) Borland C++ 5.5.1 / dmake mingw.org's gcc-4.3.0 / dmake mingw.org's gcc-3.4.5 / dmake mingw-w64.sf's 32-bit gcc-4.4.3 / dmake (There's a bug with that last compiler on XP. The perl it builds on XP hangs on XP, but runs ok if copied across to Vista. I think this is unrelated to the patches - probably even unrelated to perl. Without these patches perl will not even build using that last compiler.) On 64-bit Vista: 32-bit MSVC++ 7.0 / nmake (uses win32/Makefile) 32-bit MSVC++ 7.0 / dmake (uses win32/makfile.mk) 32-bit Borland C++ 5.5.1 / dmake mingw.org's 32-bit gcc-4.4.0 / dmake mingw.org's 32-bit gcc-3.4.5 / dmake mingw-w64.sf's 32-bit gcc-4.4.3 / dmake mingw-w64.sf's 64-bit gcc-4.4.3 / dmake mingw-w64.sf's 64-bit x86_64-w64-mingw32-gcc-4.4.3 / dmake 64-bit MicrosoftPlatform SDK for Windows Server 2003 R2 / dmake (uses win32/makefile.mk) 64-bit MicrosoftPlatform SDK for Windows Server 2003 R2 / nmake (uses win32/Makefile) Not all of those builds pass all tests - but where the removal of the patches still permits perl to build, the same tests still fail. That is, *nothing* is lost by including these patches - but there are significant gains. Each of the above builds was done according to the normal win32 configuration parameters - ie multi-threaded, non debug. No unusual config settings were applied. (I did build one debug perl on Vista using mingw-w64.sf's 32-bit gcc-4.4.3 and it built fine.) Please feel free to apply these patches (with or without modification) - and, yes, you're more than welcome to blame me if they cause any breakages ;-) Of course, some of those compilers (Borland, Microsoft, and the compilers from mingw.org) already build perl *without* having to apply any patches. It's just the other compilers that need the patches. The purpose of testing with Borland, Microsoft, and the mingw.org compilers is just to check that these patches don't break them. As a final check, I've done a build on my aging linux (mandrake-9.1) box, gcc-3.2.2. I built with '-des -Duselongdouble -Duse64bitint -Dusedevel'. No problem with that, either. If there's additional testing requirements please let me know, and I'll try to oblige. I believe the patch applied successfully for me - see below my sig for the output. Cheers, Rob Rob@desktop2 ~/GIT/blead $ patch -p0 <blead_diff.diff patching file dist/threads/threads.xs patching file handy.h patching file cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm patching file op.c Hunk #1 succeeded at 5774 (offset 47 lines). patching file pp_pack.c patching file util.c Hunk #1 succeeded at 5366 (offset -28 lines). patching file win32/makefile.mk patching file win32/perlhost.h patching file win32/win32.c patching file win32/win32.h patching file README.win32 patching file XSUB.h
* [perl #57176] Including XSUB.h before perl.h gives nasty errorfawaka@gmail.com (via RT)2009-01-251-6/+0
|
* Assigning to DEFSV leaks if PL_defgv's gp_sv isn't set.Marcus Holland-Moritz2008-11-081-2/+2
| | | | | | | | | As Nicholas already noted in a FIXME, assigning to DEFSV should use GvSV instead of GvSVn. This change ensures that, at least under -DPERL_CORE, DEFSV cannot be assigned to and introduces a DEFSV_set macro to allow setting DEFSV. This fixes #53038: map leaks memory. p4raw-id: //depot/perl@34776
* Update copyright years.Nicholas Clark2008-10-251-1/+1
| | | p4raw-id: //depot/perl@34585
* Missed three sv_2mortal(newSVpvn(...))s in the headers.Nicholas Clark2008-01-031-1/+1
| | | p4raw-id: //depot/perl@32820
* SWIG uses XS() like this (in the perlrun.swg template):Abhijit Menon-Sen2007-08-101-4/+16
| | | | | | | | | | | | typedef XS(SwigPerlWrapper); typedef SwigPerlWrapper *SwigPerlWrapperPtr; This breaks if XS() includes the 'extern "C"' decoration under C++. The appended patch provides an XSPROTO() macro that could be used by SWIG instead. (Patch from Jan Dubois to fix breakage caused by #28734.) p4raw-id: //depot/perl@31697
* XSUB.h - silence MSVC6 compiler warningRobert May2007-07-251-1/+3
| | | | | | From: "Robert May" <robertmay@cpan.org> Message-ID: <54bdc7510707211829t67e8b82eo7d8e722e73c6a3b3@mail.gmail.com> p4raw-id: //depot/perl@31653
* Consting dump.cAndy Lester2007-05-251-1/+1
| | | | | Message-Id: <B46A083E-A133-4D38-9BE8-BE1EB0AAA326@petdance.com> p4raw-id: //depot/perl@31270
* Cast markstack values to I32Jan Dubois2007-04-101-2/+2
| | | | | Message-ID: <prol131i8b27re246alnhmem4mj13fcl2b@4ax.com> p4raw-id: //depot/perl@30879
* Update copyright years in .h files. Also, in .plRafael Garcia-Suarez2007-01-051-2/+2
| | | | | | files that generate .h files, so they'll be ready next time. p4raw-id: //depot/perl@29695
* 4th patch from: Marcus Holland-Moritz2007-01-041-2/+2
| | | | | | | | | Subject: [PATCH] Cleanup SVf arguments (2nd try) Message-ID: <20070101201613.4120d9ef@r2d2> Introduce an SVfARG() macro for %SVf (%-p here) arguments to perl's printf p4raw-id: //depot/perl@29687
* The first three patches from:Marcus Holland-Moritz2007-01-041-2/+2
| | | | | | | | Subject: [PATCH] Cleanup SVf arguments (2nd try) Message-ID: <20070101201613.4120d9ef@r2d2> Adds (void*) casts to %-p and %p printf arguments p4raw-id: //depot/perl@29686
* Remove no longer used magic vtableRafael Garcia-Suarez2007-01-041-1/+0
| | | p4raw-id: //depot/perl@29684
* Using explicit printf-like APIs with a format of "%s" isn't the world'sNicholas Clark2006-10-181-1/+1
| | | | | most efficient idea. p4raw-id: //depot/perl@29042
* Revert change 28962 (at least until a better solution is found)Rafael Garcia-Suarez2006-10-081-0/+1
| | | p4raw-id: //depot/perl@28966