summaryrefslogtreecommitdiff
path: root/perl.h
Commit message (Collapse)AuthorAgeFilesLines
* perl.h: Fix typos in conditional macro namesTAKAI Kousuke2021-01-141-2/+2
|
* perl.h - enable USE_QUADMATH builds (mingw compilers only) on MS Windowssisyphus2021-01-101-1/+16
| | | | Align __float128 when using 64-bit mingw compilers.
* Use SSize_t for read lock counterKarl Williamson2020-12-311-1/+1
| | | | | | | We have tests to make sure this doesn't go negative, but wrongly declared the variable as unsigned. Spotted by Craig Berry.
* Add GETENV_LOCKKarl Williamson2020-12-191-0/+17
| | | | | | | | get_env() needs to lock other threads from writing to the environment while it is executing. It may need to have an exclusive lock if those threads can clobber its buffer before it gets a chance to save them. The previous commit has added a Configure probe which tells us if that is the case. This commit uses it to select which type of mutex to use.
* perl.h: Add capability for many-reader ENV mutex lockingKarl Williamson2020-12-191-12/+12
| | | | | | | | There are several places where there could be a problem in the environment were changed by another thread when a function is executing, but otherwise if another thread were reading the environment at the same time, there isn't a problem. This adds mutex for that situation. Future commits will take advantage of it.
* perl.h: White-space onlyKarl Williamson2020-12-131-50/+50
| | | | Properly indent some nested #defines
* many-reader mutexes: Change structure element nameKarl Williamson2020-12-121-1/+1
| | | | | The old name did not encompass all the possible reasons for the mutex signal condition to be invoked
* Fix freebsd/netbsd buildsKarl Williamson2020-12-081-2/+3
| | | | | | | These have an inconsistent configuration in which several functions exist for thread-safe locales, but the crucial one doesn't show up in our Configure probe. The code this commit fixes assumed that all or nothing would be present.
* Name individual locale locksKarl Williamson2020-12-081-5/+48
| | | | | | | | | These locks for different functions all use the same underlying mutex; but that may not always be the case. By creating separate names used only when we think they will be necessary, the compiler will complain if the conditions in the code that actually use them are the same. Doing this showed a misspelling in an #ifdef, fixed in 9289d4dc7a3d24b20c6e25045e687321ee3e8faf
* Refactor locale mutex setupKarl Williamson2020-12-081-80/+108
| | | | | | | | | | | | | | | | | | | | | | | This was prompted by my realization that even on a locale thread-safe platform, there are functions we call that may not be thread-safe in that they return their results in an internal static buffer, which may be process-wide instead of per-thread. Tomasz Konojacki++ briefly looked at Windows source code for localeconv() and this indeed did appear to be the case. If we thought a platform was thread-safe, no locale mutexes were set up, and instead the calls in the code to lock were no-oops. This would lead to potential races, the most likely candidate being localeconv(). None have been reported, at least as far as we know. Likely that function isn't called frequently. This would be true on both Posix 2008 and Windows platforms, except possibly for FreeBSD, which may be the only platform that we support that has a localeconv_l() function, which is supposed to be immune from this issue.. The solution adopted here is to test for all the possible functions that the Perl core uses that may be susceptible to this, and to set up the mutex if any are found. Thus there won't be no-ops where there should be a lock.
* Change name of mutex macro.Karl Williamson2020-12-081-6/+6
| | | | | This macro is for localeconv(); the new name is clearer as to the meaning, and this preps for further changes.
* Fix up many-reader mutex typedefKarl Williamson2020-12-081-2/+2
| | | | This previously worked on some compilers, but not others.
* Not all Win32 compilers have a small macro bufferKarl Williamson2020-12-061-1/+1
| | | | | | | | | | | | Commit e7ae132ec78 consolidated PERL_SMALL_MACRO_BUFFER usages, but it omitted the _MSC_VER number at which the buffer became large enough. Apparently it did this because Windows compilations were failing with the error "string too long", which doesn't happen if __ASSERT_ expands to nothing, which it does under PERL_SMALL_MACRO_BUFFER. However, commits 92a0bb2 and 88086fd shortened the offending strings so later Windows compilers don't have to be considered as having small macro buffers.
* perl.h: Move some code aroundKarl Williamson2020-12-061-47/+52
| | | | | This is in preparation for future commits where things will be needed earlier/later than currently.
* Always define dMY_CXT_SV, and to dNOOPKarl Williamson2020-12-061-2/+5
|
* perl.h: Remove ';' from 'NOOP;'Karl Williamson2020-12-041-4/+4
| | | | These are useless here
* Add mutex locking for many-reader/1-writerKarl Williamson2020-11-261-0/+9
| | | | | | The mutex macros already in perl are sufficient to allow us to emulate this type of locking, which may also be available natively, but I don't think it is worth the effort to use the native calls.
* perlapi: Document UVf, as deprecatedKarl Williamson2020-11-231-1/+7
|
* Document dTHXa, dTHXoaKarl Williamson2020-11-211-0/+11
|
* Document NUM2PTRKarl Williamson2020-11-211-0/+8
| | | | or at least lead people to use something better
* perlapi: Document memzeroKarl Williamson2020-11-181-0/+6
|
* Remove PERLIO_FUNCS_CONSTKarl Williamson2020-11-181-3/+0
| | | | | As the comment said, this was temporary until vtables got to be all const
* perlapi: Document Perlacos and similarKarl Williamson2020-11-111-0/+35
|
* Add a few helpers to B for INVLISTNicolas R2020-11-101-0/+1
| | | | | | | | | | | | | This commit provide some basic method to access to internal fields from one INVLIST: SVt_INVLIST - prev_index - is_offset - array_len - get_invlist_array This allows B::C to be walk and save invlists.
* perl.h: Fix misplaced #ifdefKarl Williamson2020-11-061-2/+2
| | | | | | | This fixes GH #18295 The #ifdef introduced in 6bcc290 was meant to go after the line that it actually did
* perlapi: PERL_ABS takes an argumentKarl Williamson2020-11-061-1/+1
|
* autodoc.pl: Enhance apidoc_section featureKarl Williamson2020-11-061-24/+24
| | | | | | | | | | | 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.
* Certain PERL_UNICODE symbols are core onlyKarl Williamson2020-11-021-0/+4
|
* perlapi: Document IV_MAX, UV_MAXKarl Williamson2020-11-021-0/+19
|
* perl.h: Fix rarely compiled syntax errorsKarl Williamson2020-10-221-2/+2
| | | | This #ifdef'd code clearly doesn't get compiled, as it would fail.
* perl.h: Fix typo in commentKarl Williamson2020-10-221-2/+3
|
* perl.h: Call macro instead of expanding it outKarl Williamson2020-10-221-3/+3
|
* HP cc can't handle NOT_REACHEDKarl Williamson2020-10-151-1/+1
| | | | | | Like solaris, trying to give the hint to the compiler that we know this area of the code is unreachable, merely results in the warning we were trying to suppress. So turn it off.
* Change name of intermediary macro, and #undef itKarl Williamson2020-10-151-3/+4
| | | | | | Instead of using an underscore to mark this as private, we can #undef this intermediary after use, as it isn't needed to be defined outside the small area is is used in in perl.h
* Fix __builtin_unreachableKarl Williamson2020-10-151-1/+1
| | | | | | Tomasz Konojacki pointed out on #irc that the formulation in 5d5b9c460e2a06563d2b5e35a1a79991460696eb was wrong, and the correction here is the right way of doing it.
* Refactor and document ASSUME()Karl Williamson2020-10-141-23/+37
| | | | | | | | | | | | | | The blead definition doesn't compile when I use Devel::PPPort earlier than some point in the 5.19 series. Examining the code, I noticed that there was a potential cyclic definition: ASSUME can call NOTREACHED, and NOTREACHED can call assume. Blead also assumed without checking that __builtin_unreachable() exists. So, I refactored things so that there is no cycle, and changed a few words in the comments to turn them into pod, and the new version compiles all the way back.
* Document NOOP, dNOOP, dVARKarl Williamson2020-10-141-11/+32
| | | | | This commit also moves the definition of dVAR down so its controlling #ifdef is combined with the next #ifdef
* Add details to pod for foo(MAX|INT)_C entriesKarl Williamson2020-10-081-0/+10
|
* perl.h: White-space onlyKarl Williamson2020-10-071-54/+54
| | | | | Indent preprocessor directives now enclosed within a new #ifdef block from the previous commit
* perl.h: Restrict to core likely to conflict macro namesKarl Williamson2020-10-071-0/+2
| | | | | | This header defines symbols like N0, N1 that could easily be used innocently by some XS code for its own purposes. We shouldn't pollute the name space with names the likes of these.
* Document NV to int cast macrosKarl Williamson2020-09-291-0/+15
|
* Silence compiler warningKarl Williamson2020-09-271-1/+1
| | | | Spotted by James Keenan
* Add re::optimization()Hugo van der Sanden2020-09-251-1/+2
| | | | | Given a compiled regexp object, this returns a hashref of the optimization information discovered for it.
* Non-Configure code required to implement a strict by default optionTodd Rinaldo2020-09-151-0/+10
|
* Document INT16_C, etcKarl Williamson2020-09-051-2/+24
|
* Change docs display for PERL_UNUSED_fooKarl Williamson2020-09-051-3/+3
| | | | These should have a semicolon after each in their usage
* Document PERL_UNUSED_DECLKarl Williamson2020-09-051-1/+19
|
* Document cPERLscopeKarl Williamson2020-09-051-0/+8
|
* Document PL_hexdigitKarl Williamson2020-09-051-0/+16
|
* Improve docs for PERL_foo_MAX/MINKarl Williamson2020-09-051-38/+19
| | | | | This puts these in the new sections of perlapi, and makes them display better.