summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Fix the internals of our hash functions to used unsigned values during hashGregory P. Smith2012-12-111-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | computation as the overflow behavior of signed integers is undefined. NOTE: This change is smaller compared to 3.2 as much of this cleanup had already been done. I added the comment that my change in 3.2 added so that the code would match up. Otherwise this just adds or synchronizes appropriate UL designations on some constants to be pedantic. In practice we require compiling everything with -fwrapv which forces overflow to be defined as twos compliment but this keeps the code cleaner for checkers or in the case where someone has compiled it without -fwrapv or their compiler's equivalent. We could work to get rid of the -fwrapv requirement in 3.4 but that requires more planning. Found by Clang trunk's Undefined Behavior Sanitizer (UBSan). Cleanup only - no functionality or hash values change.
| * Fix the internals of our hash functions to used unsigned values during hashGregory P. Smith2012-12-111-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | computation as the overflow behavior of signed integers is undefined. NOTE: This change is smaller compared to 3.2 as much of this cleanup had already been done. I added the comment that my change in 3.2 added so that the code would match up. Otherwise this just adds or synchronizes appropriate UL designations on some constants to be pedantic. In practice we require compiling everything with -fwrapv which forces overflow to be defined as twos compliment but this keeps the code cleaner for checkers or in the case where someone has compiled it without -fwrapv or their compiler's equivalent. Found by Clang trunk's Undefined Behavior Sanitizer (UBSan). Cleanup only - no functionality or hash values change.
| | * Fix the internals of our hash functions to used unsigned values during hashGregory P. Smith2012-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | computation as the overflow behavior of signed integers is undefined. In practice we require compiling everything with -fwrapv which forces overflow to be defined as twos compliment but this keeps the code cleaner for checkers or in the case where someone has compiled it without -fwrapv or their compiler's equivalent. Found by Clang trunk's Undefined Behavior Sanitizer (UBSan). Cleanup only - no functionality or hash values change.
* | | Using 'long double' to force this structure to be worst case aligned is noGregory P. Smith2012-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | longer required as of Python 2.5+ when the gc_refs changed from an int (4 bytes) to a Py_ssize_t (8 bytes) as the minimum size is 16 bytes. The use of a 'long double' triggered a warning by Clang trunk's Undefined-Behavior Sanitizer as on many platforms a long double requires 16-byte alignment but the Python memory allocator only guarantees 8 byte alignment. So our code would allocate and use these structures with technically improper alignment. Though it didn't matter since the 'dummy' field is never used. This silences that warning. Spelunking into code history, the double was added in 2001 to force better alignment on some platforms and changed to a long double in 2002 to appease Tru64. That issue should no loner be present since the upgrade from int to Py_ssize_t where the minimum structure size increased to 16 (unless anyone knows of a platform where ssize_t is 4 bytes?) or 24 bytes depending on if the build uses 4 or 8 byte pointers. We can probably get rid of the double and this union hack all together today. That is a slightly more invasive change that can be left for later. A more correct non-hacky alternative if any alignment issues are still found would be to use a compiler specific alignment declaration on the structure and determine which value to use at configure time.
* | | Issue #13390: New function :func:`sys.getallocatedblocks()` returns the ↵Antoine Pitrou2012-12-091-0/+2
| | | | | | | | | | | | | | | | | | number of memory blocks currently allocated. Also, the ``-R`` option to regrtest uses this function to guard against memory allocation leaks.
* | | Issue #16602: When a weakref's target was part of a long deallocation chain, ↵Antoine Pitrou2012-12-081-1/+11
|\ \ \ | |/ / | | | | | | | | | | | | the object could remain reachable through its weakref even though its refcount had dropped to zero. Thanks to Eugene Toder for diagnosing and reporting the issue.
| * | Issue #16602: When a weakref's target was part of a long deallocation chain, ↵Antoine Pitrou2012-12-081-1/+11
| |\ \ | | |/ | | | | | | | | | | | | the object could remain reachable through its weakref even though its refcount had dropped to zero. Thanks to Eugene Toder for diagnosing and reporting the issue.
| | * Issue #16602: When a weakref's target was part of a long deallocation chain, ↵Antoine Pitrou2012-12-081-1/+11
| | | | | | | | | | | | | | | | | | the object could remain reachable through its weakref even though its refcount had dropped to zero. Thanks to Eugene Toder for diagnosing and reporting the issue.
* | | create NameConstant AST class for None, True, and False literals (closes #16619)Benjamin Peterson2012-12-062-2/+11
| | |
* | | Update comment: SAVE_EXC_STATE and SWAP_EXC_STATE macroses are ↵Andrew Svetlov2012-12-051-2/+2
|\ \ \ | |/ / | | | | | | saave_exc_state and swap_exc_state functions now.
| * | Update comment: SAVE_EXC_STATE and SWAP_EXC_STATE macroses are ↵Andrew Svetlov2012-12-051-2/+2
| | | | | | | | | | | | saave_exc_state and swap_exc_state functions now.
| * | Issue 10052: merge fix from 3.2.Mark Dickinson2012-12-021-8/+21
| |\ \ | | |/
| | * Issue 10052: fix failed uint32_t / uint64_t / int32_t / int64_t detection on ↵Mark Dickinson2012-12-021-8/+21
| | | | | | | | | | | | some platforms.
| * | Backport 9dd4638de73b.Stefan Krah2012-11-181-1/+1
| | |
* | | Issue #16455: On FreeBSD and Solaris, if the locale is C, theVictor Stinner2012-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | ASCII/surrogateescape codec is now used, instead of the locale encoding, to decode the command line arguments. This change fixes inconsistencies with os.fsencode() and os.fsdecode() because these operating systems announces an ASCII locale encoding, whereas the ISO-8859-1 encoding is used in practice.
* | | Issue 10052: fix failed uint32_t / uint64_t / int32_t / int64_t detection on ↵Mark Dickinson2012-12-021-8/+21
| | | | | | | | | | | | some platforms.
* | | remove unused flag (closes #16505)Benjamin Peterson2012-11-191-1/+0
| | |
* | | Issue #6308: Try to fix the termios build failure on HP-UX.Stefan Krah2012-11-181-1/+1
| | |
* | | Issue #16451: Refactor to remove duplication between range and slice in ↵Mark Dickinson2012-11-171-0/+3
| | | | | | | | | | | | slice index computations.
* | | Merge 3.3.Stefan Krah2012-11-121-0/+8
|\ \ \ | |/ /
| * | Issue #15835: Define PATH_MAX on HP-UX.Stefan Krah2012-11-121-0/+8
| | |
* | | Issue #5765: Merge from 3.3Nick Coghlan2012-11-041-0/+2
|\ \ \ | |/ /
| * | Issue #5765: Apply a hard recursion limit in the compilerNick Coghlan2012-11-041-0/+2
| | | | | | | | | | | | | | | | | | | | | Previously, excessive nesting in expressions would blow the stack and segfault the interpreter. Now, a hard limit based on the configured recursion limit and a hardcoded scaling factor is applied.
* | | point errors related to nonlocals and globals to the statement declaring ↵Benjamin Peterson2012-11-011-0/+1
| | | | | | | | | | | | them (closes #10189)
* | | make PyGrammar_LabelRepr return a const char * (closes #16369)Benjamin Peterson2012-10-311-1/+1
| | |
* | | Issue #16086: PyTypeObject.tp_flags and PyType_Spec.flags are now unsignedVictor Stinner2012-10-301-21/+21
| | | | | | | | | | | | | | | | | | ... (unsigned long and unsigned int) to avoid an undefined behaviour with Py_TPFLAGS_TYPE_SUBCLASS ((1 << 31). PyType_GetFlags() result type is now unsigned too (unsigned long, instead of long).
* | | Issue #16330: Use surrogate-related macrosVictor Stinner2012-10-301-3/+3
| | | | | | | | | | | | Patch written by Serhiy Storchaka.
* | | Minor typo fix.Georg Brandl2012-10-281-1/+1
| | |
* | | make _PyParser_TokenNames constBenjamin Peterson2012-10-241-1/+1
| | |
* | | Issue #16166: Add PY_LITTLE_ENDIAN and PY_BIG_ENDIAN macros and unifiedChristian Heimes2012-10-171-0/+14
| | | | | | | | | | | | endianess detection and handling.
* | | Issue #16148: Small improvements and cleanup. Added version informationArmin Ronacher2012-10-071-1/+3
| | | | | | | | | | | | to docs.
* | | Issue #16147: Rewrite PyUnicode_FromFormatV() to use _PyUnicodeWriter APIVictor Stinner2012-10-061-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Simplify the code: replace 4 steps with one unique step using the _PyUnicodeWriter API. PyUnicode_Format() has the same design. It avoids to store intermediate results which require to allocate an array of pointers on the heap. * Use the _PyUnicodeWriter API for speed (and its convinient API): overallocate the buffer to reduce the number of "realloc()" * Implement "width" and "precision" in Python, don't rely on sprintf(). It avoids to need of a temporary buffer allocated on the heap: only use a small buffer allocated in the stack. * Add _PyUnicodeWriter_WriteCstr() function * Split PyUnicode_FromFormatV() into two functions: add unicode_fromformat_arg(). * Inline parse_format_flags(): the format of an argument is now only parsed once, it's no more needed to have a subfunction. * Optimize PyUnicode_FromFormatV() for characters between two "%" arguments: search the next "%" and copy the substring in one chunk, instead of copying character per character.
* | | Issue #16148: implemented PEP 424Armin Ronacher2012-10-061-3/+2
| | |
* | | #16127: merge with 3.3.Ezio Melotti2012-10-051-2/+1
|\ \ \ | |/ /
| * | #16127: remove outdated references to narrow builds. Patch by Serhiy Storchaka.Ezio Melotti2012-10-051-2/+1
| | |
| * | merge mostly from defaultBenjamin Peterson2012-09-294-11/+22
| |\ \
| * | | Post-release update.Georg Brandl2012-09-291-1/+1
| | | |
* | | | #16135: Removal of OS/2 support (C code and Docs)Jesus Cea2012-10-052-10/+1
| | | |
* | | | Enable also ptr==ptr optimization in PyUnicode_Compare()Victor Stinner2012-10-041-1/+2
| | | | | | | | | | | | | | | | It was already implemented in PyUnicode_RichCompare()
* | | | Bump version to 3.4.0 alpha 0.Georg Brandl2012-09-291-3/+3
| |/ / |/| |
* | | Merge with main repo default branch.Georg Brandl2012-09-294-11/+22
|\ \ \ | |/ / |/| |
| * | Merge with 3.3.0 release clone.Georg Brandl2012-09-241-2/+2
| |\ \
| * | | GCC doesn't support typeof in strict ansi mode (e.g. -ansi or -std=c89)Christian Heimes2012-09-231-1/+1
| | | |
| * | | Issue #15144: Fix possible integer overflow when handling pointers as ↵Antoine Pitrou2012-09-202-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | integer values, by using Py_uintptr_t instead of size_t. Patch by Serhiy Storchaka.
| * | | Merge in changes from 3.3.0rc2 release clone.Georg Brandl2012-09-091-2/+2
| |\ \ \
| * \ \ \ Issue #13992: The trashcan mechanism is now thread-safe. This eliminatesAntoine Pitrou2012-09-052-9/+21
| |\ \ \ \ | | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sporadic crashes in multi-thread programs when several long deallocator chains ran concurrently and involved subclasses of built-in container types. Note that the trashcan functions are part of the stable ABI, therefore they have to be kept around for binary compatibility of extensions.
| | * | | Issue #13992: The trashcan mechanism is now thread-safe. This eliminatesAntoine Pitrou2012-09-052-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sporadic crashes in multi-thread programs when several long deallocator chains ran concurrently and involved subclasses of built-in container types. Because of this change, a couple extension modules compiled for 3.2.4 (those which use the trashcan mechanism, despite it being undocumented) will not be loadable by 3.2.3 and earlier. However, extension modules compiled for 3.2.3 and earlier will be loadable by 3.2.4.
| * | | | Merge whitespace fix from 3.2.Trent Nelson2012-08-311-4/+4
| |\ \ \ \ | | |/ / /
| | * | | Remove trailing whitespace in order to silence warnings on HP-UX.Trent Nelson2012-08-311-4/+4
| | | | |
* | | | | Bump version to 3.3.0 final.Georg Brandl2012-09-291-3/+3
| |_|_|/ |/| | |