Nuitka-winsvc 2.4.11__cp311-cp311-win_amd64.whl → 2.5.6__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/METADATA +56 -109
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/RECORD +304 -280
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/WHEEL +1 -1
- nuitka/Builtins.py +31 -0
- nuitka/HardImportRegistry.py +8 -0
- nuitka/MainControl.py +9 -4
- nuitka/OptionParsing.py +108 -54
- nuitka/Options.py +69 -13
- nuitka/OutputDirectories.py +7 -2
- nuitka/PostProcessing.py +69 -38
- nuitka/Progress.py +16 -1
- nuitka/PythonVersions.py +2 -1
- nuitka/Serialization.py +4 -2
- nuitka/Tracing.py +69 -1
- nuitka/Version.py +2 -2
- nuitka/build/Backend.scons +45 -5
- nuitka/build/CCompilerVersion.scons +6 -0
- nuitka/build/Onefile.scons +6 -0
- nuitka/build/SconsCaching.py +4 -0
- nuitka/build/SconsCompilerSettings.py +14 -3
- nuitka/build/SconsInterface.py +3 -0
- nuitka/build/SconsUtils.py +5 -0
- nuitka/build/include/nuitka/allocator.h +124 -1
- nuitka/build/include/nuitka/calling.h +6 -6
- nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
- nuitka/build/include/nuitka/compiled_frame.h +2 -1
- nuitka/build/include/nuitka/constants.h +8 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/exceptions.h +264 -121
- nuitka/build/include/nuitka/helper/attributes.h +0 -4
- nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +75 -31
- nuitka/build/include/nuitka/helper/ints.h +86 -37
- nuitka/build/include/nuitka/helper/iterators.h +82 -34
- nuitka/build/include/nuitka/helper/operations.h +3 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
- nuitka/build/include/nuitka/helper/raising.h +47 -28
- nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
- nuitka/build/include/nuitka/helper/tuples.h +12 -0
- nuitka/build/include/nuitka/helpers.h +12 -2
- nuitka/build/include/nuitka/prelude.h +36 -25
- nuitka/build/include/nuitka/printing.h +9 -7
- nuitka/build/include/nuitka/threading.h +15 -1
- nuitka/build/include/nuitka/type_aliases.h +3 -0
- nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
- nuitka/build/inline_copy/stubgen/six.py +998 -0
- nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
- nuitka/build/static_src/CompiledCellType.c +6 -4
- nuitka/build/static_src/CompiledCodeHelpers.c +106 -40
- nuitka/build/static_src/CompiledCoroutineType.c +41 -31
- nuitka/build/static_src/CompiledFrameType.c +110 -79
- nuitka/build/static_src/CompiledFunctionType.c +173 -151
- nuitka/build/static_src/CompiledGeneratorType.c +51 -49
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +433 -46
- nuitka/build/static_src/CompiledMethodType.c +6 -12
- nuitka/build/static_src/HelpersAllocator.c +266 -28
- nuitka/build/static_src/HelpersAttributes.c +0 -21
- nuitka/build/static_src/HelpersBuiltin.c +23 -14
- nuitka/build/static_src/HelpersCalling.c +7 -7
- nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
- nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
- nuitka/build/static_src/HelpersComparisonEq.c +18 -4
- nuitka/build/static_src/HelpersComparisonGe.c +18 -4
- nuitka/build/static_src/HelpersComparisonGt.c +18 -4
- nuitka/build/static_src/HelpersComparisonLe.c +18 -4
- nuitka/build/static_src/HelpersComparisonLt.c +18 -4
- nuitka/build/static_src/HelpersComparisonNe.c +18 -4
- nuitka/build/static_src/HelpersConsole.c +34 -8
- nuitka/build/static_src/HelpersConstantsBlob.c +4 -2
- nuitka/build/static_src/HelpersDeepcopy.c +1 -0
- nuitka/build/static_src/HelpersDictionaries.c +195 -36
- nuitka/build/static_src/HelpersDictionariesGenerated.c +12 -107
- nuitka/build/static_src/HelpersExceptions.c +24 -50
- nuitka/build/static_src/HelpersFiles.c +79 -5
- nuitka/build/static_src/HelpersImport.c +13 -9
- nuitka/build/static_src/HelpersImportHard.c +23 -46
- nuitka/build/static_src/HelpersLists.c +98 -9
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
- nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
- nuitka/build/static_src/HelpersProfiling.c +1 -1
- nuitka/build/static_src/HelpersRaising.c +255 -310
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +2 -2
- nuitka/build/static_src/HelpersTypes.c +98 -2
- nuitka/build/static_src/MainProgram.c +132 -28
- nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
- nuitka/build/static_src/OnefileBootstrap.c +6 -1
- nuitka/code_generation/AsyncgenCodes.py +2 -6
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
- nuitka/code_generation/BuiltinCodes.py +9 -1
- nuitka/code_generation/CallCodes.py +16 -16
- nuitka/code_generation/CodeGeneration.py +14 -2
- nuitka/code_generation/CodeHelperSelection.py +1 -1
- nuitka/code_generation/CodeHelpers.py +4 -1
- nuitka/code_generation/CodeObjectCodes.py +2 -2
- nuitka/code_generation/ComparisonCodes.py +13 -2
- nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
- nuitka/code_generation/Contexts.py +28 -16
- nuitka/code_generation/CoroutineCodes.py +2 -6
- nuitka/code_generation/DictCodes.py +3 -3
- nuitka/code_generation/ErrorCodes.py +34 -50
- nuitka/code_generation/ExceptionCodes.py +165 -96
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
- nuitka/code_generation/FrameCodes.py +4 -11
- nuitka/code_generation/FunctionCodes.py +2 -6
- nuitka/code_generation/GeneratorCodes.py +2 -6
- nuitka/code_generation/GlobalConstants.py +8 -2
- nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
- nuitka/code_generation/IteratorCodes.py +67 -54
- nuitka/code_generation/LineNumberCodes.py +1 -3
- nuitka/code_generation/ModuleCodes.py +28 -4
- nuitka/code_generation/OperationCodes.py +51 -20
- nuitka/code_generation/PackageResourceCodes.py +37 -0
- nuitka/code_generation/RaisingCodes.py +164 -90
- nuitka/code_generation/Reports.py +13 -5
- nuitka/code_generation/ReturnCodes.py +2 -16
- nuitka/code_generation/TryCodes.py +12 -24
- nuitka/code_generation/TypeAliasCodes.py +48 -0
- nuitka/code_generation/VariableCodes.py +99 -40
- nuitka/code_generation/VariableDeclarations.py +8 -8
- nuitka/code_generation/YieldCodes.py +1 -1
- nuitka/code_generation/c_types/CTypeBases.py +10 -2
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
- nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
- nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
- nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
- nuitka/code_generation/templates/CodeTemplatesVariables.py +76 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +4 -106
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
- nuitka/containers/Namedtuples.py +6 -0
- nuitka/containers/OrderedSets.py +105 -5
- nuitka/distutils/Build.py +14 -0
- nuitka/distutils/DistutilCommands.py +50 -10
- nuitka/finalizations/Finalization.py +3 -3
- nuitka/finalizations/FinalizeMarkups.py +10 -14
- nuitka/freezer/DependsExe.py +5 -2
- nuitka/freezer/DllDependenciesMacOS.py +18 -1
- nuitka/freezer/DllDependenciesWin32.py +26 -12
- nuitka/freezer/ImportDetection.py +6 -0
- nuitka/freezer/IncludedDataFiles.py +37 -6
- nuitka/freezer/Onefile.py +1 -0
- nuitka/freezer/Standalone.py +72 -18
- nuitka/importing/Importing.py +33 -6
- nuitka/importing/Recursion.py +5 -2
- nuitka/importing/StandardLibrary.py +57 -59
- nuitka/nodes/AsyncgenNodes.py +3 -6
- nuitka/nodes/BuiltinIteratorNodes.py +2 -2
- nuitka/nodes/BuiltinRefNodes.py +14 -30
- nuitka/nodes/ChildrenHavingMixins.py +439 -46
- nuitka/nodes/ConditionalNodes.py +3 -2
- nuitka/nodes/CoroutineNodes.py +3 -6
- nuitka/nodes/DictionaryNodes.py +1 -1
- nuitka/nodes/ExceptionNodes.py +102 -26
- nuitka/nodes/ExpressionBasesGenerated.py +288 -4
- nuitka/nodes/FrameNodes.py +22 -11
- nuitka/nodes/FunctionNodes.py +3 -3
- nuitka/nodes/GeneratorNodes.py +3 -6
- nuitka/nodes/HardImportNodesGenerated.py +182 -0
- nuitka/nodes/ImportNodes.py +2 -2
- nuitka/nodes/NodeBases.py +28 -1
- nuitka/nodes/NodeMakingHelpers.py +71 -50
- nuitka/nodes/OperatorNodesUnary.py +128 -3
- nuitka/nodes/OsSysNodes.py +37 -6
- nuitka/nodes/OutlineNodes.py +2 -2
- nuitka/nodes/StatementBasesGenerated.py +0 -2
- nuitka/nodes/StatementNodes.py +8 -7
- nuitka/nodes/SubscriptNodes.py +1 -1
- nuitka/nodes/TypeNodes.py +28 -1
- nuitka/nodes/VariableAssignNodes.py +2 -1
- nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +18 -0
- nuitka/nodes/shapes/StandardShapes.py +47 -44
- nuitka/optimizations/BytecodeDemotion.py +2 -1
- nuitka/plugins/PluginBase.py +64 -22
- nuitka/plugins/Plugins.py +16 -3
- nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
- nuitka/plugins/standard/DllFilesPlugin.py +78 -2
- nuitka/plugins/standard/ImplicitImports.py +5 -15
- nuitka/plugins/standard/KivyPlugin.py +3 -12
- nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
- nuitka/plugins/standard/OptionsNannyPlugin.py +5 -4
- nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
- nuitka/plugins/standard/TkinterPlugin.py +23 -3
- nuitka/plugins/standard/TransformersPlugin.py +70 -275
- nuitka/plugins/standard/standard.nuitka-package.config.yml +413 -30
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
- nuitka/reports/CompilationReportReader.py +12 -0
- nuitka/reports/Reports.py +11 -0
- nuitka/specs/BuiltinParameterSpecs.py +5 -1
- nuitka/specs/HardImportSpecs.py +7 -0
- nuitka/specs/ParameterSpecs.py +4 -4
- nuitka/tools/environments/Virtualenv.py +13 -5
- nuitka/tools/general/dll_report/__main__.py +10 -1
- nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
- nuitka/tools/podman/__main__.py +4 -2
- nuitka/tools/specialize/CTypeDescriptions.py +158 -9
- nuitka/tools/specialize/SpecializeC.py +218 -56
- nuitka/tools/testing/Common.py +69 -62
- nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
- nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
- nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
- nuitka/tools/watch/AutoStage.py +1 -0
- nuitka/tree/Building.py +10 -37
- nuitka/tree/ComplexCallHelperFunctions.py +4 -0
- nuitka/tree/ReformulationAssertStatements.py +31 -14
- nuitka/tree/ReformulationAssignmentStatements.py +5 -1
- nuitka/tree/ReformulationClasses3.py +94 -19
- nuitka/tree/ReformulationDictionaryCreation.py +1 -0
- nuitka/tree/ReformulationFunctionStatements.py +1 -1
- nuitka/tree/ReformulationMatchStatements.py +3 -1
- nuitka/tree/ReformulationYieldExpressions.py +23 -5
- nuitka/utils/CommandLineOptions.py +27 -3
- nuitka/utils/Download.py +2 -2
- nuitka/utils/Execution.py +36 -31
- nuitka/utils/FileOperations.py +18 -39
- nuitka/utils/Hashing.py +5 -1
- nuitka/utils/Importing.py +2 -14
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +9 -4
- nuitka/utils/Json.py +2 -2
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/SharedLibraries.py +24 -0
- nuitka/utils/Signing.py +9 -1
- nuitka/utils/Utils.py +1 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka-run.cmd +0 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/top_level.txt +0 -0
|
@@ -18,6 +18,11 @@
|
|
|
18
18
|
extern void *(*python_obj_malloc)(void *ctx, size_t size);
|
|
19
19
|
extern void *(*python_mem_malloc)(void *ctx, size_t size);
|
|
20
20
|
extern void *(*python_mem_calloc)(void *ctx, size_t nelem, size_t elsize);
|
|
21
|
+
#ifndef Py_GIL_DISABLED
|
|
22
|
+
extern void *(*python_mem_realloc)(void *ctx, void *ptr, size_t new_size);
|
|
23
|
+
#else
|
|
24
|
+
extern void (*python_mem_free)(void *ctx, void *ptr);
|
|
25
|
+
#endif
|
|
21
26
|
|
|
22
27
|
#if defined(Py_DEBUG)
|
|
23
28
|
extern void *python_obj_ctx;
|
|
@@ -40,10 +45,31 @@ NUITKA_MAY_BE_UNUSED static void *NuitkaMem_Calloc(size_t nelem, size_t elsize)
|
|
|
40
45
|
return python_mem_calloc(python_mem_ctx, nelem, elsize);
|
|
41
46
|
}
|
|
42
47
|
|
|
48
|
+
#ifndef Py_GIL_DISABLED
|
|
49
|
+
// Our version of "PyMem_Realloc".
|
|
50
|
+
NUITKA_MAY_BE_UNUSED static void *NuitkaMem_Realloc(void *ptr, size_t new_size) {
|
|
51
|
+
return python_mem_realloc(python_mem_ctx, ptr, new_size);
|
|
52
|
+
}
|
|
53
|
+
#else
|
|
54
|
+
NUITKA_MAY_BE_UNUSED static void NuitkaMem_Free(void *ptr) { python_mem_free(python_mem_ctx, ptr); }
|
|
55
|
+
#endif
|
|
56
|
+
|
|
43
57
|
#else
|
|
44
58
|
#define NuitkaObject_Malloc(size) PyObject_MALLOC(size)
|
|
45
59
|
#define NuitkaMem_Malloc(size) PyMem_MALLOC(size)
|
|
46
|
-
#define NuitkaMem_Calloc(elem, elsize)
|
|
60
|
+
#define NuitkaMem_Calloc(elem, elsize) PyMem_Calloc(elem, elsize)
|
|
61
|
+
#ifndef Py_GIL_DISABLED
|
|
62
|
+
#if defined(_WIN32)
|
|
63
|
+
// On Windows, mixing different runtime DLLs can cause issues at
|
|
64
|
+
// release, so we need to go through the API to get the proper
|
|
65
|
+
// DLL runtime.
|
|
66
|
+
#define NuitkaMem_Realloc(ptr, new_size) PyMem_Realloc(ptr, new_size)
|
|
67
|
+
#else
|
|
68
|
+
#define NuitkaMem_Realloc(ptr, new_size) PyMem_REALLOC(ptr, new_size)
|
|
69
|
+
#endif
|
|
70
|
+
#else
|
|
71
|
+
#define NuitkaMem_Free(ptr) PyMem_Free(ptr)
|
|
72
|
+
#endif
|
|
47
73
|
#endif
|
|
48
74
|
|
|
49
75
|
#if PYTHON_VERSION >= 0x380 && PYTHON_VERSION < 0x3c0
|
|
@@ -102,6 +128,48 @@ static inline void _Nuitka_Py_XDECREF(PyObject *ob) {
|
|
|
102
128
|
} \
|
|
103
129
|
} while (0)
|
|
104
130
|
|
|
131
|
+
#elif PYTHON_VERSION >= 0x3c0 && defined(_WIN32) && !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && \
|
|
132
|
+
!defined(Py_GIL_DISABLED) && !defined(_NUITKA_EXPERIMENTAL_DISABLE_PY_DECREF_OVERRIDE)
|
|
133
|
+
|
|
134
|
+
#undef Py_DECREF
|
|
135
|
+
#define Py_DECREF(arg) \
|
|
136
|
+
do { \
|
|
137
|
+
PyObject *op = _PyObject_CAST(arg); \
|
|
138
|
+
if (_Py_IsImmortal(op)) { \
|
|
139
|
+
break; \
|
|
140
|
+
} \
|
|
141
|
+
_Py_DECREF_STAT_INC(); \
|
|
142
|
+
if (--op->ob_refcnt == 0) { \
|
|
143
|
+
destructor dealloc = Py_TYPE(op)->tp_dealloc; \
|
|
144
|
+
(*dealloc)(op); \
|
|
145
|
+
} \
|
|
146
|
+
} while (0)
|
|
147
|
+
|
|
148
|
+
#undef Py_XDECREF
|
|
149
|
+
#define Py_XDECREF(arg) \
|
|
150
|
+
do { \
|
|
151
|
+
PyObject *xop = _PyObject_CAST(arg); \
|
|
152
|
+
if (xop != NULL) { \
|
|
153
|
+
Py_DECREF(xop); \
|
|
154
|
+
} \
|
|
155
|
+
} while (0)
|
|
156
|
+
|
|
157
|
+
#undef Py_IS_TYPE
|
|
158
|
+
#define Py_IS_TYPE(ob, type) (_PyObject_CAST(ob)->ob_type == (type))
|
|
159
|
+
|
|
160
|
+
#undef _Py_DECREF_SPECIALIZED
|
|
161
|
+
#define _Py_DECREF_SPECIALIZED(arg, dealloc) \
|
|
162
|
+
do { \
|
|
163
|
+
PyObject *op = _PyObject_CAST(arg); \
|
|
164
|
+
if (_Py_IsImmortal(op)) { \
|
|
165
|
+
break; \
|
|
166
|
+
} \
|
|
167
|
+
_Py_DECREF_STAT_INC(); \
|
|
168
|
+
if (--op->ob_refcnt == 0) { \
|
|
169
|
+
destructor d = (destructor)(dealloc); \
|
|
170
|
+
d(op); \
|
|
171
|
+
} \
|
|
172
|
+
} while (0)
|
|
105
173
|
#endif
|
|
106
174
|
|
|
107
175
|
// For Python3.12, avoid reference management if value is known to be immortal.
|
|
@@ -131,6 +199,7 @@ static inline void Nuitka_Py_NewReference(PyObject *op) {
|
|
|
131
199
|
#if PYTHON_VERSION < 0x3c0
|
|
132
200
|
_Py_RefTotal++;
|
|
133
201
|
#else
|
|
202
|
+
// Refcounts are now in the interpreter state, spell-checker: ignore reftotal
|
|
134
203
|
_PyInterpreterState_GET()->object_state.reftotal++;
|
|
135
204
|
#endif
|
|
136
205
|
#endif
|
|
@@ -307,6 +376,60 @@ static void inline Py_SET_REFCNT_IMMORTAL(PyObject *object) {
|
|
|
307
376
|
#define Py_SET_REFCNT_IMMORTAL(object)
|
|
308
377
|
#endif
|
|
309
378
|
|
|
379
|
+
// Have these defines from newer Python for all Python versions available
|
|
380
|
+
#ifndef _Py_CAST
|
|
381
|
+
#define _Py_CAST(type, expr) ((type)(expr))
|
|
382
|
+
#endif
|
|
383
|
+
|
|
384
|
+
#ifndef _PyObject_CAST
|
|
385
|
+
#define _PyObject_CAST(op) _Py_CAST(PyObject *, (op))
|
|
386
|
+
#endif
|
|
387
|
+
|
|
388
|
+
#ifndef Py_SETREF
|
|
389
|
+
#ifdef _Py_TYPEOF
|
|
390
|
+
#define Py_SETREF(dst, src) \
|
|
391
|
+
do { \
|
|
392
|
+
_Py_TYPEOF(dst) *_tmp_dst_ptr = &(dst); \
|
|
393
|
+
_Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \
|
|
394
|
+
*_tmp_dst_ptr = (src); \
|
|
395
|
+
Py_DECREF(_tmp_old_dst); \
|
|
396
|
+
} while (0)
|
|
397
|
+
#else
|
|
398
|
+
#define Py_SETREF(dst, src) \
|
|
399
|
+
do { \
|
|
400
|
+
PyObject **_tmp_dst_ptr = _Py_CAST(PyObject **, &(dst)); \
|
|
401
|
+
PyObject *_tmp_old_dst = (*_tmp_dst_ptr); \
|
|
402
|
+
PyObject *_tmp_src = _PyObject_CAST(src); \
|
|
403
|
+
memcpy(_tmp_dst_ptr, &_tmp_src, sizeof(PyObject *)); \
|
|
404
|
+
Py_DECREF(_tmp_old_dst); \
|
|
405
|
+
} while (0)
|
|
406
|
+
#endif
|
|
407
|
+
#endif
|
|
408
|
+
|
|
409
|
+
#ifndef Py_XSETREF
|
|
410
|
+
/* Py_XSETREF() is a variant of Py_SETREF() that uses Py_XDECREF() instead of
|
|
411
|
+
* Py_DECREF().
|
|
412
|
+
*/
|
|
413
|
+
#ifdef _Py_TYPEOF
|
|
414
|
+
#define Py_XSETREF(dst, src) \
|
|
415
|
+
do { \
|
|
416
|
+
_Py_TYPEOF(dst) *_tmp_dst_ptr = &(dst); \
|
|
417
|
+
_Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \
|
|
418
|
+
*_tmp_dst_ptr = (src); \
|
|
419
|
+
Py_XDECREF(_tmp_old_dst); \
|
|
420
|
+
} while (0)
|
|
421
|
+
#else
|
|
422
|
+
#define Py_XSETREF(dst, src) \
|
|
423
|
+
do { \
|
|
424
|
+
PyObject **_tmp_dst_ptr = _Py_CAST(PyObject **, &(dst)); \
|
|
425
|
+
PyObject *_tmp_old_dst = (*_tmp_dst_ptr); \
|
|
426
|
+
PyObject *_tmp_src = _PyObject_CAST(src); \
|
|
427
|
+
memcpy(_tmp_dst_ptr, &_tmp_src, sizeof(PyObject *)); \
|
|
428
|
+
Py_XDECREF(_tmp_old_dst); \
|
|
429
|
+
} while (0)
|
|
430
|
+
#endif
|
|
431
|
+
#endif
|
|
432
|
+
|
|
310
433
|
#endif
|
|
311
434
|
|
|
312
435
|
// Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
@@ -81,24 +81,24 @@ NUITKA_MAY_BE_UNUSED static PyObject *CALL_FUNCTION(PyThreadState *tstate, PyObj
|
|
|
81
81
|
extern PyObject *CALL_FUNCTION_NO_ARGS(PyThreadState *tstate, PyObject *called);
|
|
82
82
|
|
|
83
83
|
// Function call variants with positional arguments tuple.
|
|
84
|
-
NUITKA_MAY_BE_UNUSED static PyObject *
|
|
85
|
-
|
|
84
|
+
NUITKA_MAY_BE_UNUSED static PyObject *CALL_FUNCTION_WITH_POS_ARGS(PyThreadState *tstate, PyObject *function_object,
|
|
85
|
+
PyObject *positional_args) {
|
|
86
86
|
return CALL_FUNCTION(tstate, function_object, positional_args, NULL);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// Method call variants with positional arguments tuple.
|
|
90
|
-
extern PyObject *
|
|
91
|
-
|
|
90
|
+
extern PyObject *CALL_METHOD_WITH_POS_ARGS(PyThreadState *tstate, PyObject *source, PyObject *attr_name,
|
|
91
|
+
PyObject *positional_args);
|
|
92
92
|
|
|
93
93
|
// TODO: Specialize in template too.
|
|
94
|
-
NUITKA_MAY_BE_UNUSED static PyObject *
|
|
94
|
+
NUITKA_MAY_BE_UNUSED static PyObject *CALL_FUNCTION_WITH_KW_ARGS(PyThreadState *tstate, PyObject *function_object,
|
|
95
95
|
PyObject *named_args) {
|
|
96
96
|
return CALL_FUNCTION(tstate, function_object, const_tuple_empty, named_args);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// Call built-in functions with using defaulted values.
|
|
100
100
|
extern PyObject *CALL_BUILTIN_KW_ARGS(PyThreadState *tstate, PyObject *callable, PyObject **args,
|
|
101
|
-
char const **arg_names, int max_args);
|
|
101
|
+
char const **arg_names, int max_args, int kw_only_args);
|
|
102
102
|
|
|
103
103
|
// For abstract class instantiation error message, during call.
|
|
104
104
|
extern void formatCannotInstantiateAbstractClass(PyThreadState *tstate, PyTypeObject *type);
|
|
@@ -104,6 +104,10 @@ static inline void SAVE_ASYNCGEN_EXCEPTION(PyThreadState *tstate, struct Nuitka_
|
|
|
104
104
|
* Python3.7: The exception is preserved in the asyncgen object itself
|
|
105
105
|
* which has a new "m_exc_state" structure just for that.
|
|
106
106
|
*/
|
|
107
|
+
#if _DEBUG_EXCEPTIONS
|
|
108
|
+
PRINT_STRING("SAVE_ASYNCGEN_EXCEPTION: Enter\n");
|
|
109
|
+
PRINT_PUBLISHED_EXCEPTION();
|
|
110
|
+
#endif
|
|
107
111
|
|
|
108
112
|
#if PYTHON_VERSION < 0x3b0
|
|
109
113
|
PyObject *saved_exception_type = EXC_TYPE(tstate);
|
|
@@ -113,11 +117,6 @@ static inline void SAVE_ASYNCGEN_EXCEPTION(PyThreadState *tstate, struct Nuitka_
|
|
|
113
117
|
PyTracebackObject *saved_exception_traceback = EXC_TRACEBACK(tstate);
|
|
114
118
|
#endif
|
|
115
119
|
|
|
116
|
-
#if _DEBUG_EXCEPTIONS
|
|
117
|
-
PRINT_STRING("SAVE_ASYNCGEN_EXCEPTION: Enter\n");
|
|
118
|
-
PRINT_EXCEPTION(saved_exception_type, saved_exception_value, saved_exception_traceback);
|
|
119
|
-
#endif
|
|
120
|
-
|
|
121
120
|
#if PYTHON_VERSION < 0x370
|
|
122
121
|
EXC_TYPE(tstate) = tstate->frame->f_exc_type;
|
|
123
122
|
EXC_VALUE(tstate) = tstate->frame->f_exc_value;
|
|
@@ -134,7 +133,7 @@ static inline void SAVE_ASYNCGEN_EXCEPTION(PyThreadState *tstate, struct Nuitka_
|
|
|
134
133
|
|
|
135
134
|
#if _DEBUG_EXCEPTIONS
|
|
136
135
|
PRINT_STRING("SAVE_ASYNCGEN_EXCEPTION: Leave\n");
|
|
137
|
-
|
|
136
|
+
PRINT_PUBLISHED_EXCEPTION();
|
|
138
137
|
#endif
|
|
139
138
|
|
|
140
139
|
#if PYTHON_VERSION < 0x370
|
|
@@ -166,7 +165,11 @@ static inline void RESTORE_ASYNCGEN_EXCEPTION(PyThreadState *tstate, struct Nuit
|
|
|
166
165
|
|
|
167
166
|
#if _DEBUG_EXCEPTIONS
|
|
168
167
|
PRINT_STRING("RESTORE_ASYNCGEN_EXCEPTION: Enter\n");
|
|
168
|
+
#if PYTHON_VERSION < 0x3b0
|
|
169
169
|
PRINT_EXCEPTION(saved_exception_type, saved_exception_value, saved_exception_traceback);
|
|
170
|
+
#else
|
|
171
|
+
_PRINT_EXCEPTION1(saved_exception_value);
|
|
172
|
+
#endif
|
|
170
173
|
#endif
|
|
171
174
|
|
|
172
175
|
#if PYTHON_VERSION < 0x370
|
|
@@ -197,7 +200,7 @@ static inline void RESTORE_ASYNCGEN_EXCEPTION(PyThreadState *tstate, struct Nuit
|
|
|
197
200
|
|
|
198
201
|
#if _DEBUG_EXCEPTIONS
|
|
199
202
|
PRINT_STRING("RESTORE_ASYNCGEN_EXCEPTION: Leave\n");
|
|
200
|
-
|
|
203
|
+
PRINT_PUBLISHED_EXCEPTION();
|
|
201
204
|
#endif
|
|
202
205
|
|
|
203
206
|
#if PYTHON_VERSION < 0x3b0
|
|
@@ -143,7 +143,7 @@ NUITKA_MAY_BE_UNUSED static inline bool isFrameUnusable(struct Nuitka_FrameObjec
|
|
|
143
143
|
frame_object == NULL ||
|
|
144
144
|
// Still in use
|
|
145
145
|
Py_REFCNT(frame_object) > 1 ||
|
|
146
|
-
#if PYTHON_VERSION <
|
|
146
|
+
#if PYTHON_VERSION < 0x300
|
|
147
147
|
// Last used by another thread (TODO: Could just set it when re-using)
|
|
148
148
|
frame_object->m_frame.f_tstate != PyThreadState_GET() ||
|
|
149
149
|
#endif
|
|
@@ -483,6 +483,7 @@ NUITKA_MAY_BE_UNUSED inline static void pushFrameStackGeneratorCompiledFrame(PyT
|
|
|
483
483
|
#define NUITKA_TYPE_DESCRIPTION_OBJECT 'o'
|
|
484
484
|
#define NUITKA_TYPE_DESCRIPTION_OBJECT_PTR 'O'
|
|
485
485
|
#define NUITKA_TYPE_DESCRIPTION_BOOL 'b'
|
|
486
|
+
#define NUITKA_TYPE_DESCRIPTION_NILONG 'L'
|
|
486
487
|
|
|
487
488
|
#if _DEBUG_REFCOUNTS
|
|
488
489
|
extern int count_active_Nuitka_Frame_Type;
|
|
@@ -87,6 +87,10 @@ extern PyObject **global_constants;
|
|
|
87
87
|
#define const_str_plain_range global_constants[29]
|
|
88
88
|
// 'rb'
|
|
89
89
|
#define const_str_plain_rb global_constants[29]
|
|
90
|
+
// 'b'
|
|
91
|
+
#define const_str_plain_b global_constants[29]
|
|
92
|
+
// 'w'
|
|
93
|
+
#define const_str_plain_w global_constants[29]
|
|
90
94
|
// 'open'
|
|
91
95
|
#define const_str_plain_open global_constants[30]
|
|
92
96
|
// 'keys'
|
|
@@ -139,6 +143,10 @@ extern PyObject **global_constants;
|
|
|
139
143
|
#define const_str_plain_isfile global_constants[42]
|
|
140
144
|
// 'listdir'
|
|
141
145
|
#define const_str_plain_listdir global_constants[42]
|
|
146
|
+
// 'lstat'
|
|
147
|
+
#define const_str_plain_lstat global_constants[42]
|
|
148
|
+
// 'stat'
|
|
149
|
+
#define const_str_plain_stat global_constants[42]
|
|
142
150
|
// 'basename'
|
|
143
151
|
#define const_str_plain_basename global_constants[42]
|
|
144
152
|
// 'dirname'
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
|
+
|
|
3
|
+
// No guard on purpose, must include this only once for real.
|
|
4
|
+
|
|
5
|
+
#ifdef _NUITKA_EXPERIMENTAL_DEBUG_FRAME
|
|
6
|
+
#define _DEBUG_FRAME 1
|
|
7
|
+
#else
|
|
8
|
+
#define _DEBUG_FRAME 0
|
|
9
|
+
#endif
|
|
10
|
+
#ifdef _NUITKA_EXPERIMENTAL_DEBUG_REFRAME
|
|
11
|
+
#define _DEBUG_REFRAME 1
|
|
12
|
+
#else
|
|
13
|
+
#define _DEBUG_REFRAME 0
|
|
14
|
+
#endif
|
|
15
|
+
#ifdef _NUITKA_EXPERIMENTAL_DEBUG_EXCEPTIONS
|
|
16
|
+
#define _DEBUG_EXCEPTIONS 1
|
|
17
|
+
#else
|
|
18
|
+
#define _DEBUG_EXCEPTIONS 0
|
|
19
|
+
#endif
|
|
20
|
+
#ifdef _NUITKA_EXPERIMENTAL_DEBUG_GENERATOR
|
|
21
|
+
#define _DEBUG_GENERATOR 1
|
|
22
|
+
#else
|
|
23
|
+
#define _DEBUG_GENERATOR 0
|
|
24
|
+
#endif
|
|
25
|
+
#ifdef _NUITKA_EXPERIMENTAL_DEBUG_COROUTINE
|
|
26
|
+
#define _DEBUG_COROUTINE 1
|
|
27
|
+
#else
|
|
28
|
+
#define _DEBUG_COROUTINE 0
|
|
29
|
+
#endif
|
|
30
|
+
#ifdef _NUITKA_EXPERIMENTAL_DEBUG_ASYNCGEN
|
|
31
|
+
#define _DEBUG_ASYNCGEN 1
|
|
32
|
+
#else
|
|
33
|
+
#define _DEBUG_ASYNCGEN 0
|
|
34
|
+
#endif
|
|
35
|
+
#ifdef _NUITKA_EXPERIMENTAL_DEBUG_CLASSES
|
|
36
|
+
#define _DEBUG_CLASSES 1
|
|
37
|
+
#else
|
|
38
|
+
#define _DEBUG_CLASSES 0
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
#ifdef _NUITKA_EXPERIMENTAL_REPORT_REFCOUNTS
|
|
42
|
+
#define _DEBUG_REFCOUNTS 1
|
|
43
|
+
#else
|
|
44
|
+
#define _DEBUG_REFCOUNTS 0
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
// Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
48
|
+
// integrates with CPython, but also works on its own.
|
|
49
|
+
//
|
|
50
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
51
|
+
// you may not use this file except in compliance with the License.
|
|
52
|
+
// You may obtain a copy of the License at
|
|
53
|
+
//
|
|
54
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
55
|
+
//
|
|
56
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
57
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
58
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
59
|
+
// See the License for the specific language governing permissions and
|
|
60
|
+
// limitations under the License.
|