mirror of
https://github.com/python/cpython.git
synced 2025-09-01 22:47:59 +00:00
bpo-43166: Disable ceval.c optimizations for Windows debug builds (GH-32023)
Also increases the stack allocation when run with `python_d.exe` to account for the extra stack checks that are added.
This commit is contained in:
parent
7ba7eae508
commit
cd05d0a423
3 changed files with 2 additions and 16 deletions
|
@ -170,23 +170,12 @@ typedef Py_ssize_t Py_ssize_clean_t;
|
||||||
* Py_LOCAL_INLINE does the same thing, and also explicitly requests inlining,
|
* Py_LOCAL_INLINE does the same thing, and also explicitly requests inlining,
|
||||||
* for platforms that support that.
|
* for platforms that support that.
|
||||||
*
|
*
|
||||||
* If PY_LOCAL_AGGRESSIVE is defined before python.h is included, more
|
|
||||||
* "aggressive" inlining/optimization is enabled for the entire module. This
|
|
||||||
* may lead to code bloat, and may slow things down for those reasons. It may
|
|
||||||
* also lead to errors, if the code relies on pointer aliasing. Use with
|
|
||||||
* care.
|
|
||||||
*
|
|
||||||
* NOTE: You can only use this for functions that are entirely local to a
|
* NOTE: You can only use this for functions that are entirely local to a
|
||||||
* module; functions that are exported via method tables, callbacks, etc,
|
* module; functions that are exported via method tables, callbacks, etc,
|
||||||
* should keep using static.
|
* should keep using static.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
# if defined(PY_LOCAL_AGGRESSIVE)
|
|
||||||
/* enable more aggressive optimization for MSVC */
|
|
||||||
/* active in both release and debug builds - see bpo-43271 */
|
|
||||||
# pragma optimize("gt", on)
|
|
||||||
#endif
|
|
||||||
/* ignore warnings if the compiler decides not to inline a function */
|
/* ignore warnings if the compiler decides not to inline a function */
|
||||||
# pragma warning(disable: 4710)
|
# pragma warning(disable: 4710)
|
||||||
/* fastest possible local call under MSVC */
|
/* fastest possible local call under MSVC */
|
||||||
|
|
|
@ -94,7 +94,8 @@
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<StackReserveSize>2000000</StackReserveSize>
|
<StackReserveSize Condition="$(Configuration) != 'Debug'">2000000</StackReserveSize>
|
||||||
|
<StackReserveSize Condition="$(Configuration) == 'Debug'">4000000</StackReserveSize>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
XXX document it!
|
XXX document it!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* enable more aggressive intra-module optimizations, where available */
|
|
||||||
/* affects both release and debug builds - see bpo-43271 */
|
|
||||||
#define PY_LOCAL_AGGRESSIVE
|
|
||||||
|
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
#include "pycore_abstract.h" // _PyIndex_Check()
|
#include "pycore_abstract.h" // _PyIndex_Check()
|
||||||
#include "pycore_call.h" // _PyObject_FastCallDictTstate()
|
#include "pycore_call.h" // _PyObject_FastCallDictTstate()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue