pytron-kit 0.3.12__py3-none-macosx_11_0_universal2.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.
- pytron/__init__.py +112 -0
- pytron/application.py +562 -0
- pytron/apputils/__init__.py +0 -0
- pytron/apputils/chrome_ipc.py +203 -0
- pytron/apputils/codegen.py +261 -0
- pytron/apputils/config.py +303 -0
- pytron/apputils/deadmansswitch.py +47 -0
- pytron/apputils/extras.py +76 -0
- pytron/apputils/native.py +148 -0
- pytron/apputils/shell.py +73 -0
- pytron/apputils/windows.py +286 -0
- pytron/cli.py +384 -0
- pytron/commands/__init__.py +0 -0
- pytron/commands/android.py +28 -0
- pytron/commands/build.py +26 -0
- pytron/commands/doctor.py +221 -0
- pytron/commands/engine.py +23 -0
- pytron/commands/frontend.py +60 -0
- pytron/commands/harvest.py +112 -0
- pytron/commands/helpers.py +239 -0
- pytron/commands/info.py +50 -0
- pytron/commands/init.py +521 -0
- pytron/commands/install.py +294 -0
- pytron/commands/login.py +130 -0
- pytron/commands/package.py +228 -0
- pytron/commands/plugin.py +442 -0
- pytron/commands/run.py +312 -0
- pytron/commands/scan.py +210 -0
- pytron/commands/show.py +23 -0
- pytron/commands/uninstall.py +150 -0
- pytron/commands/utils.py +42 -0
- pytron/commands/workflow.py +95 -0
- pytron/console.py +133 -0
- pytron/core.py +18 -0
- pytron/dependencies/WebView2Loader.dll +0 -0
- pytron/dependencies/__init__.py +1 -0
- pytron/dependencies/pytron_native.so +0 -0
- pytron/engines/chrome/adapter.py +445 -0
- pytron/engines/chrome/engine.py +576 -0
- pytron/engines/chrome/forge.py +147 -0
- pytron/engines/chrome/shell/package.json +8 -0
- pytron/engines/chrome/shell/preload.js +12 -0
- pytron/engines/chrome/shell/shell.js +534 -0
- pytron/exceptions.py +36 -0
- pytron/inspector.py +201 -0
- pytron/inspector_ui.py +512 -0
- pytron/installer/Installation.nsi +236 -0
- pytron/installer/header.bmp +0 -0
- pytron/installer/pytron.ico +0 -0
- pytron/installer/sidebar.bmp +0 -0
- pytron/llms.md +98 -0
- pytron/manifests/README.md +29 -0
- pytron/manifests/windows-utf8.manifest +44 -0
- pytron/menu.py +128 -0
- pytron/nsis-setup.exe +0 -0
- pytron/pack/__init__.py +0 -0
- pytron/pack/assets.py +131 -0
- pytron/pack/compilers.py +289 -0
- pytron/pack/crystal.py +297 -0
- pytron/pack/graph.py +377 -0
- pytron/pack/inference.py +157 -0
- pytron/pack/installers.py +402 -0
- pytron/pack/introspect.py +357 -0
- pytron/pack/metadata.py +213 -0
- pytron/pack/modules.py +618 -0
- pytron/pack/nuitka.py +108 -0
- pytron/pack/pipeline.py +107 -0
- pytron/pack/pyinstaller.py +176 -0
- pytron/pack/rust_engine.py +273 -0
- pytron/pack/secure.py +309 -0
- pytron/pack/secure_loader/bin/pytron_rust_bootloader +0 -0
- pytron/pack/secure_loader/icon.ico +0 -0
- pytron/pack/utils.py +110 -0
- pytron/pack/virtual_root.py +124 -0
- pytron/platforms/__init__.py +0 -0
- pytron/platforms/android/__init__.py +3 -0
- pytron/platforms/android/android.py +103 -0
- pytron/platforms/android/builder.py +736 -0
- pytron/platforms/android/ops/build.py +79 -0
- pytron/platforms/android/ops/init.py +63 -0
- pytron/platforms/android/ops/run.py +79 -0
- pytron/platforms/android/ops/sync.py +770 -0
- pytron/platforms/android/ops/utils.py +8 -0
- pytron/platforms/android/shell/README.md +30 -0
- pytron/platforms/android/shell/app/build.gradle +64 -0
- pytron/platforms/android/shell/app/src/main/AndroidManifest.xml +29 -0
- pytron/platforms/android/shell/app/src/main/assets/python/main.py +86 -0
- pytron/platforms/android/shell/app/src/main/assets/python/python314.zip +0 -0
- pytron/platforms/android/shell/app/src/main/cpp/CMakeLists.txt +25 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/Python.h +155 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/abstract.h +915 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/audit.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bltinmodule.h +14 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/boolobject.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bytearrayobject.h +44 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bytesobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/ceval.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/codecs.h +176 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/compile.h +22 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/complexobject.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/abstract.h +104 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/audit.h +8 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytearrayobject.h +38 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytesobject.h +42 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/cellobject.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/ceval.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/classobject.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/code.h +340 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/compile.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/complexobject.h +33 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/context.h +107 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/critical_section.h +154 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/descrobject.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/dictobject.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileobject.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileutils.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/floatobject.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/frameobject.h +35 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/funcobject.h +185 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/genobject.h +56 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/import.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/initconfig.h +334 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/listobject.h +53 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/lock.h +74 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longintrepr.h +184 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longobject.h +89 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/memoryobject.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/methodobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/modsupport.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/monitoring.h +269 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/object.h +493 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/objimpl.h +104 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/odictobject.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/picklebufobject.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pthread_stubs.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic.h +614 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_gcc.h +615 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_msc.h +1197 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_std.h +1112 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyctype.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pydebug.h +38 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyerrors.h +132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyfpe.h +15 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyframe.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyhash.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pylifecycle.h +89 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pymem.h +84 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystate.h +275 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystats.h +194 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythonrun.h +96 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythread.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pytime.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/setobject.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/traceback.h +13 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tracemalloc.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tupleobject.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/unicodeobject.h +773 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/warnings.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/weakrefobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/critical_section.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/datetime.h +267 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/descrobject.h +100 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/dictobject.h +108 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/dynamic_annotations.h +499 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/enumobject.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/errcode.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/exports.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/fileobject.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/fileutils.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/floatobject.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/frameobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/genericaliasobject.h +14 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/import.h +103 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/atomic.h +392 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/internal.h +969 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/prim.h +329 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/track.h +147 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/types.h +721 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc.h +565 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_abstract.h +61 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_asdl.h +112 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast.h +945 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast_state.h +271 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_atexit.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_audit.h +35 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_backoff.h +133 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bitutils.h +186 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_blocks_output_buffer.h +321 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_brc.h +73 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytes_methods.h +82 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytesobject.h +149 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_c_array.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_call.h +206 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_capsule.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_cell.h +75 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval.h +390 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval_state.h +48 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_code.h +671 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_codecs.h +76 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_compile.h +230 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_complexobject.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_condvar.h +93 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_context.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_critical_section.h +237 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp.h +406 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp_data_registry.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_debug_offsets.h +379 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_descrobject.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict.h +410 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict_state.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dtoa.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_signal.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_trampoline.h +70 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_exceptions.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_faulthandler.h +100 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils.h +320 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils_windows.h +98 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_floatobject.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_flowgraph.h +47 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_format.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_frame.h +61 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist.h +111 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist_state.h +70 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_function.h +53 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gc.h +378 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_genobject.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_getopt.h +22 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gil.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects_fini_generated.h +1592 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_strings.h +854 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hamt.h +113 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hashtable.h +150 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_import.h +141 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_importdl.h +139 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_index_pool.h +36 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_initconfig.h +197 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruction_sequence.h +83 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruments.h +127 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp.h +109 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp_structs.h +977 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe.h +401 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe_structs.h +95 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpolation.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_intrinsics.h +51 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_jit.h +29 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_list.h +81 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_llist.h +106 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_lock.h +236 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_long.h +319 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_magic_number.h +305 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_memoryobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_mimalloc.h +69 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_modsupport.h +99 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_moduleobject.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_namespace.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object.h +1029 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_alloc.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_deferred.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_stack.h +95 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_state.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc.h +702 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc_init.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_metadata.h +2117 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_utils.h +90 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_optimizer.h +318 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parking_lot.h +97 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parser.h +78 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pathconfig.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyarena.h +68 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyatomic_ft_wrappers.h +174 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pybuffer.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyerrors.h +213 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyhash.h +91 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pylifecycle.h +136 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymath.h +205 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem_init.h +103 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystate.h +339 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystats.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythonrun.h +68 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythread.h +172 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_qsbr.h +172 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_range.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime.h +63 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init.h +239 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init_generated.h +1589 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_structs.h +310 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_semaphore.h +67 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_setobject.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_signal.h +108 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sliceobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stackref.h +791 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stats.h +97 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_strhex.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structs.h +88 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structseq.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_symtable.h +201 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sysmodule.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_template.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_time.h +334 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_token.h +110 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_traceback.h +111 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tracemalloc.h +164 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tstate.h +88 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tuple.h +75 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typedefs.h +18 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typeobject.h +155 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typevarobject.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ucnhash.h +36 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject.h +308 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject_generated.h +3132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unionobject.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uniqueid.h +57 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_ids.h +335 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_metadata.h +1204 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_warnings.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_weakref.h +133 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/intrcheck.h +23 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/iterobject.h +24 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/listobject.h +55 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/lock.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/longobject.h +178 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/marshal.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/memoryobject.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/methodobject.h +146 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/modsupport.h +146 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/moduleobject.h +122 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/monitoring.h +18 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/object.h +828 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/objimpl.h +211 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/opcode.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/opcode_ids.h +259 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/osdefs.h +57 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/osmodule.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/patchlevel.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/py_curses.h +117 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyatomic.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pybuffer.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pycapsule.h +58 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyconfig.h +2088 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pydtrace.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyerrors.h +335 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyexpat.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyframe.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyhash.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pylifecycle.h +80 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymacconfig.h +91 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymacro.h +243 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymath.h +65 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymem.h +110 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyport.h +710 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystate.h +132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystats.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystrcmp.h +23 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystrtod.h +37 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pythonrun.h +42 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pythread.h +131 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pytypedefs.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/rangeobject.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/refcount.h +555 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/setobject.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/sliceobject.h +69 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/structmember.h +56 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/structseq.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/sysmodule.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/traceback.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/tupleobject.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/typeslots.h +96 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/unicodeobject.h +1029 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/warnings.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/weakrefobject.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/pytron_bridge.cpp +224 -0
- pytron/platforms/android/shell/app/src/main/java/com/pytron/shell/MainActivity.kt +208 -0
- pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- pytron/platforms/android/shell/build.gradle +11 -0
- pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.jar +0 -0
- pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.properties +5 -0
- pytron/platforms/android/shell/gradle.properties +2 -0
- pytron/platforms/android/shell/gradlew.bat +85 -0
- pytron/platforms/android/shell/settings.gradle +16 -0
- pytron/platforms/darwin.py +82 -0
- pytron/platforms/darwin_ops/libs.py +31 -0
- pytron/platforms/darwin_ops/system.py +182 -0
- pytron/platforms/darwin_ops/utils.py +85 -0
- pytron/platforms/darwin_ops/webview.py +5 -0
- pytron/platforms/darwin_ops/window.py +102 -0
- pytron/platforms/interface.py +152 -0
- pytron/platforms/linux.py +82 -0
- pytron/platforms/linux_ops/libs.py +49 -0
- pytron/platforms/linux_ops/system.py +316 -0
- pytron/platforms/linux_ops/utils.py +19 -0
- pytron/platforms/linux_ops/webview.py +5 -0
- pytron/platforms/linux_ops/window.py +115 -0
- pytron/platforms/windows.py +136 -0
- pytron/platforms/windows_ops/__init__.py +0 -0
- pytron/platforms/windows_ops/constants.py +126 -0
- pytron/platforms/windows_ops/system.py +518 -0
- pytron/platforms/windows_ops/utils.py +3 -0
- pytron/platforms/windows_ops/webview.py +5 -0
- pytron/platforms/windows_ops/window.py +361 -0
- pytron/plugin.py +467 -0
- pytron/rcedit-x64.exe +0 -0
- pytron/router.py +146 -0
- pytron/serializer.py +240 -0
- pytron/shortcuts.py +279 -0
- pytron/state.py +76 -0
- pytron/tray.py +399 -0
- pytron/updater.py +181 -0
- pytron/utf8_hook.py +112 -0
- pytron/utils.py +44 -0
- pytron/webview.py +722 -0
- pytron_kit-0.3.12.dist-info/METADATA +131 -0
- pytron_kit-0.3.12.dist-info/RECORD +419 -0
- pytron_kit-0.3.12.dist-info/WHEEL +5 -0
- pytron_kit-0.3.12.dist-info/entry_points.txt +2 -0
- pytron_kit-0.3.12.dist-info/licenses/LICENSE +201 -0
- pytron_kit-0.3.12.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
#ifndef Py_INTERNAL_PYMATH_H
|
|
2
|
+
#define Py_INTERNAL_PYMATH_H
|
|
3
|
+
#ifdef __cplusplus
|
|
4
|
+
extern "C" {
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#ifndef Py_BUILD_CORE
|
|
8
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
/* _Py_ADJUST_ERANGE1(x)
|
|
13
|
+
* _Py_ADJUST_ERANGE2(x, y)
|
|
14
|
+
* Set errno to 0 before calling a libm function, and invoke one of these
|
|
15
|
+
* macros after, passing the function result(s) (_Py_ADJUST_ERANGE2 is useful
|
|
16
|
+
* for functions returning complex results). This makes two kinds of
|
|
17
|
+
* adjustments to errno: (A) If it looks like the platform libm set
|
|
18
|
+
* errno=ERANGE due to underflow, clear errno. (B) If it looks like the
|
|
19
|
+
* platform libm overflowed but didn't set errno, force errno to ERANGE. In
|
|
20
|
+
* effect, we're trying to force a useful implementation of C89 errno
|
|
21
|
+
* behavior.
|
|
22
|
+
* Caution:
|
|
23
|
+
* This isn't reliable. C99 no longer requires libm to set errno under
|
|
24
|
+
* any exceptional condition, but does require +- HUGE_VAL return
|
|
25
|
+
* values on overflow. A 754 box *probably* maps HUGE_VAL to a
|
|
26
|
+
* double infinity, and we're cool if that's so, unless the input
|
|
27
|
+
* was an infinity and an infinity is the expected result. A C89
|
|
28
|
+
* system sets errno to ERANGE, so we check for that too. We're
|
|
29
|
+
* out of luck if a C99 754 box doesn't map HUGE_VAL to +Inf, or
|
|
30
|
+
* if the returned result is a NaN, or if a C89 box returns HUGE_VAL
|
|
31
|
+
* in non-overflow cases.
|
|
32
|
+
*/
|
|
33
|
+
static inline void _Py_ADJUST_ERANGE1(double x)
|
|
34
|
+
{
|
|
35
|
+
if (errno == 0) {
|
|
36
|
+
if (x == Py_INFINITY || x == -Py_INFINITY) {
|
|
37
|
+
errno = ERANGE;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else if (errno == ERANGE && x == 0.0) {
|
|
41
|
+
errno = 0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static inline void _Py_ADJUST_ERANGE2(double x, double y)
|
|
46
|
+
{
|
|
47
|
+
if (x == Py_INFINITY || x == -Py_INFINITY ||
|
|
48
|
+
y == Py_INFINITY || y == -Py_INFINITY)
|
|
49
|
+
{
|
|
50
|
+
if (errno == 0) {
|
|
51
|
+
errno = ERANGE;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (errno == ERANGE) {
|
|
55
|
+
errno = 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
//--- HAVE_PY_SET_53BIT_PRECISION macro ------------------------------------
|
|
61
|
+
//
|
|
62
|
+
// The functions _Py_dg_strtod() and _Py_dg_dtoa() in Python/dtoa.c (which are
|
|
63
|
+
// required to support the short float repr introduced in Python 3.1) require
|
|
64
|
+
// that the floating-point unit that's being used for arithmetic operations on
|
|
65
|
+
// C doubles is set to use 53-bit precision. It also requires that the FPU
|
|
66
|
+
// rounding mode is round-half-to-even, but that's less often an issue.
|
|
67
|
+
//
|
|
68
|
+
// If your FPU isn't already set to 53-bit precision/round-half-to-even, and
|
|
69
|
+
// you want to make use of _Py_dg_strtod() and _Py_dg_dtoa(), then you should:
|
|
70
|
+
//
|
|
71
|
+
// #define HAVE_PY_SET_53BIT_PRECISION 1
|
|
72
|
+
//
|
|
73
|
+
// and also give appropriate definitions for the following three macros:
|
|
74
|
+
//
|
|
75
|
+
// * _Py_SET_53BIT_PRECISION_HEADER: any variable declarations needed to
|
|
76
|
+
// use the two macros below.
|
|
77
|
+
// * _Py_SET_53BIT_PRECISION_START: store original FPU settings, and
|
|
78
|
+
// set FPU to 53-bit precision/round-half-to-even
|
|
79
|
+
// * _Py_SET_53BIT_PRECISION_END: restore original FPU settings
|
|
80
|
+
//
|
|
81
|
+
// The macros are designed to be used within a single C function: see
|
|
82
|
+
// Python/pystrtod.c for an example of their use.
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
// Get and set x87 control word for gcc/x86
|
|
86
|
+
#ifdef HAVE_GCC_ASM_FOR_X87
|
|
87
|
+
#define HAVE_PY_SET_53BIT_PRECISION 1
|
|
88
|
+
|
|
89
|
+
// Functions defined in Python/pymath.c
|
|
90
|
+
extern unsigned short _Py_get_387controlword(void);
|
|
91
|
+
extern void _Py_set_387controlword(unsigned short);
|
|
92
|
+
|
|
93
|
+
#define _Py_SET_53BIT_PRECISION_HEADER \
|
|
94
|
+
unsigned short old_387controlword, new_387controlword
|
|
95
|
+
#define _Py_SET_53BIT_PRECISION_START \
|
|
96
|
+
do { \
|
|
97
|
+
old_387controlword = _Py_get_387controlword(); \
|
|
98
|
+
new_387controlword = (old_387controlword & ~0x0f00) | 0x0200; \
|
|
99
|
+
if (new_387controlword != old_387controlword) { \
|
|
100
|
+
_Py_set_387controlword(new_387controlword); \
|
|
101
|
+
} \
|
|
102
|
+
} while (0)
|
|
103
|
+
#define _Py_SET_53BIT_PRECISION_END \
|
|
104
|
+
do { \
|
|
105
|
+
if (new_387controlword != old_387controlword) { \
|
|
106
|
+
_Py_set_387controlword(old_387controlword); \
|
|
107
|
+
} \
|
|
108
|
+
} while (0)
|
|
109
|
+
#endif
|
|
110
|
+
|
|
111
|
+
// Get and set x87 control word for VisualStudio/x86.
|
|
112
|
+
// x87 is not supported in 64-bit or ARM.
|
|
113
|
+
#if defined(_MSC_VER) && !defined(_WIN64) && !defined(_M_ARM)
|
|
114
|
+
#define HAVE_PY_SET_53BIT_PRECISION 1
|
|
115
|
+
|
|
116
|
+
#include <float.h> // __control87_2()
|
|
117
|
+
|
|
118
|
+
#define _Py_SET_53BIT_PRECISION_HEADER \
|
|
119
|
+
unsigned int old_387controlword, new_387controlword, out_387controlword
|
|
120
|
+
// We use the __control87_2 function to set only the x87 control word.
|
|
121
|
+
// The SSE control word is unaffected.
|
|
122
|
+
#define _Py_SET_53BIT_PRECISION_START \
|
|
123
|
+
do { \
|
|
124
|
+
__control87_2(0, 0, &old_387controlword, NULL); \
|
|
125
|
+
new_387controlword = \
|
|
126
|
+
(old_387controlword & ~(_MCW_PC | _MCW_RC)) | (_PC_53 | _RC_NEAR); \
|
|
127
|
+
if (new_387controlword != old_387controlword) { \
|
|
128
|
+
__control87_2(new_387controlword, _MCW_PC | _MCW_RC, \
|
|
129
|
+
&out_387controlword, NULL); \
|
|
130
|
+
} \
|
|
131
|
+
} while (0)
|
|
132
|
+
#define _Py_SET_53BIT_PRECISION_END \
|
|
133
|
+
do { \
|
|
134
|
+
if (new_387controlword != old_387controlword) { \
|
|
135
|
+
__control87_2(old_387controlword, _MCW_PC | _MCW_RC, \
|
|
136
|
+
&out_387controlword, NULL); \
|
|
137
|
+
} \
|
|
138
|
+
} while (0)
|
|
139
|
+
#endif
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
// MC68881
|
|
143
|
+
#ifdef HAVE_GCC_ASM_FOR_MC68881
|
|
144
|
+
#define HAVE_PY_SET_53BIT_PRECISION 1
|
|
145
|
+
#define _Py_SET_53BIT_PRECISION_HEADER \
|
|
146
|
+
unsigned int old_fpcr, new_fpcr
|
|
147
|
+
#define _Py_SET_53BIT_PRECISION_START \
|
|
148
|
+
do { \
|
|
149
|
+
__asm__ ("fmove.l %%fpcr,%0" : "=g" (old_fpcr)); \
|
|
150
|
+
/* Set double precision / round to nearest. */ \
|
|
151
|
+
new_fpcr = (old_fpcr & ~0xf0) | 0x80; \
|
|
152
|
+
if (new_fpcr != old_fpcr) { \
|
|
153
|
+
__asm__ volatile ("fmove.l %0,%%fpcr" : : "g" (new_fpcr));\
|
|
154
|
+
} \
|
|
155
|
+
} while (0)
|
|
156
|
+
#define _Py_SET_53BIT_PRECISION_END \
|
|
157
|
+
do { \
|
|
158
|
+
if (new_fpcr != old_fpcr) { \
|
|
159
|
+
__asm__ volatile ("fmove.l %0,%%fpcr" : : "g" (old_fpcr)); \
|
|
160
|
+
} \
|
|
161
|
+
} while (0)
|
|
162
|
+
#endif
|
|
163
|
+
|
|
164
|
+
// Default definitions are empty
|
|
165
|
+
#ifndef _Py_SET_53BIT_PRECISION_HEADER
|
|
166
|
+
# define _Py_SET_53BIT_PRECISION_HEADER
|
|
167
|
+
# define _Py_SET_53BIT_PRECISION_START
|
|
168
|
+
# define _Py_SET_53BIT_PRECISION_END
|
|
169
|
+
#endif
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
//--- _PY_SHORT_FLOAT_REPR macro -------------------------------------------
|
|
173
|
+
|
|
174
|
+
// If we can't guarantee 53-bit precision, don't use the code
|
|
175
|
+
// in Python/dtoa.c, but fall back to standard code. This
|
|
176
|
+
// means that repr of a float will be long (17 significant digits).
|
|
177
|
+
//
|
|
178
|
+
// Realistically, there are two things that could go wrong:
|
|
179
|
+
//
|
|
180
|
+
// (1) doubles aren't IEEE 754 doubles, or
|
|
181
|
+
// (2) we're on x86 with the rounding precision set to 64-bits
|
|
182
|
+
// (extended precision), and we don't know how to change
|
|
183
|
+
// the rounding precision.
|
|
184
|
+
#if !defined(DOUBLE_IS_LITTLE_ENDIAN_IEEE754) && \
|
|
185
|
+
!defined(DOUBLE_IS_BIG_ENDIAN_IEEE754) && \
|
|
186
|
+
!defined(DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754)
|
|
187
|
+
# define _PY_SHORT_FLOAT_REPR 0
|
|
188
|
+
#endif
|
|
189
|
+
|
|
190
|
+
// Double rounding is symptomatic of use of extended precision on x86.
|
|
191
|
+
// If we're seeing double rounding, and we don't have any mechanism available
|
|
192
|
+
// for changing the FPU rounding precision, then don't use Python/dtoa.c.
|
|
193
|
+
#if defined(X87_DOUBLE_ROUNDING) && !defined(HAVE_PY_SET_53BIT_PRECISION)
|
|
194
|
+
# define _PY_SHORT_FLOAT_REPR 0
|
|
195
|
+
#endif
|
|
196
|
+
|
|
197
|
+
#ifndef _PY_SHORT_FLOAT_REPR
|
|
198
|
+
# define _PY_SHORT_FLOAT_REPR 1
|
|
199
|
+
#endif
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
#ifdef __cplusplus
|
|
203
|
+
}
|
|
204
|
+
#endif
|
|
205
|
+
#endif /* !Py_INTERNAL_PYMATH_H */
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
#ifndef Py_INTERNAL_PYMEM_H
|
|
2
|
+
#define Py_INTERNAL_PYMEM_H
|
|
3
|
+
|
|
4
|
+
#include "pycore_llist.h" // struct llist_node
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
#ifndef Py_BUILD_CORE
|
|
11
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
// Try to get the allocators name set by _PyMem_SetupAllocators().
|
|
15
|
+
// Return NULL if unknown.
|
|
16
|
+
// Export for '_testinternalcapi' shared extension.
|
|
17
|
+
PyAPI_FUNC(const char*) _PyMem_GetCurrentAllocatorName(void);
|
|
18
|
+
|
|
19
|
+
// strdup() using PyMem_RawMalloc()
|
|
20
|
+
extern char* _PyMem_RawStrdup(const char *str);
|
|
21
|
+
|
|
22
|
+
// strdup() using PyMem_Malloc().
|
|
23
|
+
// Export for '_pickle ' shared extension.
|
|
24
|
+
PyAPI_FUNC(char*) _PyMem_Strdup(const char *str);
|
|
25
|
+
|
|
26
|
+
// wcsdup() using PyMem_RawMalloc()
|
|
27
|
+
extern wchar_t* _PyMem_RawWcsdup(const wchar_t *str);
|
|
28
|
+
|
|
29
|
+
/* Special bytes broadcast into debug memory blocks at appropriate times.
|
|
30
|
+
Strings of these are unlikely to be valid addresses, floats, ints or
|
|
31
|
+
7-bit ASCII.
|
|
32
|
+
|
|
33
|
+
- PYMEM_CLEANBYTE: clean (newly allocated) memory
|
|
34
|
+
- PYMEM_DEADBYTE dead (newly freed) memory
|
|
35
|
+
- PYMEM_FORBIDDENBYTE: untouchable bytes at each end of a block
|
|
36
|
+
|
|
37
|
+
Byte patterns 0xCB, 0xDB and 0xFB have been replaced with 0xCD, 0xDD and
|
|
38
|
+
0xFD to use the same values as Windows CRT debug malloc() and free().
|
|
39
|
+
If modified, _PyMem_IsPtrFreed() should be updated as well. */
|
|
40
|
+
#define PYMEM_CLEANBYTE 0xCD
|
|
41
|
+
#define PYMEM_DEADBYTE 0xDD
|
|
42
|
+
#define PYMEM_FORBIDDENBYTE 0xFD
|
|
43
|
+
|
|
44
|
+
/* Heuristic checking if a pointer value is newly allocated
|
|
45
|
+
(uninitialized), newly freed or NULL (is equal to zero).
|
|
46
|
+
|
|
47
|
+
The pointer is not dereferenced, only the pointer value is checked.
|
|
48
|
+
|
|
49
|
+
The heuristic relies on the debug hooks on Python memory allocators which
|
|
50
|
+
fills newly allocated memory with CLEANBYTE (0xCD) and newly freed memory
|
|
51
|
+
with DEADBYTE (0xDD). Detect also "untouchable bytes" marked
|
|
52
|
+
with FORBIDDENBYTE (0xFD). */
|
|
53
|
+
static inline int _PyMem_IsPtrFreed(const void *ptr)
|
|
54
|
+
{
|
|
55
|
+
uintptr_t value = (uintptr_t)ptr;
|
|
56
|
+
#if SIZEOF_VOID_P == 8
|
|
57
|
+
return (value <= 0xff // NULL, 0x1, 0x2, ..., 0xff
|
|
58
|
+
|| value == (uintptr_t)0xCDCDCDCDCDCDCDCD
|
|
59
|
+
|| value == (uintptr_t)0xDDDDDDDDDDDDDDDD
|
|
60
|
+
|| value == (uintptr_t)0xFDFDFDFDFDFDFDFD
|
|
61
|
+
|| value >= (uintptr_t)0xFFFFFFFFFFFFFF00); // -0xff, ..., -2, -1
|
|
62
|
+
#elif SIZEOF_VOID_P == 4
|
|
63
|
+
return (value <= 0xff
|
|
64
|
+
|| value == (uintptr_t)0xCDCDCDCD
|
|
65
|
+
|| value == (uintptr_t)0xDDDDDDDD
|
|
66
|
+
|| value == (uintptr_t)0xFDFDFDFD
|
|
67
|
+
|| value >= (uintptr_t)0xFFFFFF00);
|
|
68
|
+
#else
|
|
69
|
+
# error "unknown pointer size"
|
|
70
|
+
#endif
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Similar to _PyMem_IsPtrFreed() but expects an 'unsigned long' instead of a
|
|
74
|
+
// pointer.
|
|
75
|
+
static inline int _PyMem_IsULongFreed(unsigned long value)
|
|
76
|
+
{
|
|
77
|
+
#if SIZEOF_LONG == 8
|
|
78
|
+
return (value == 0
|
|
79
|
+
|| value == (unsigned long)0xCDCDCDCDCDCDCDCD
|
|
80
|
+
|| value == (unsigned long)0xDDDDDDDDDDDDDDDD
|
|
81
|
+
|| value == (unsigned long)0xFDFDFDFDFDFDFDFD
|
|
82
|
+
|| value == (unsigned long)0xFFFFFFFFFFFFFFFF);
|
|
83
|
+
#elif SIZEOF_LONG == 4
|
|
84
|
+
return (value == 0
|
|
85
|
+
|| value == (unsigned long)0xCDCDCDCD
|
|
86
|
+
|| value == (unsigned long)0xDDDDDDDD
|
|
87
|
+
|| value == (unsigned long)0xFDFDFDFD
|
|
88
|
+
|| value == (unsigned long)0xFFFFFFFF);
|
|
89
|
+
#else
|
|
90
|
+
# error "unknown long size"
|
|
91
|
+
#endif
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
extern int _PyMem_GetAllocatorName(
|
|
95
|
+
const char *name,
|
|
96
|
+
PyMemAllocatorName *allocator);
|
|
97
|
+
|
|
98
|
+
/* Configure the Python memory allocators.
|
|
99
|
+
Pass PYMEM_ALLOCATOR_DEFAULT to use default allocators.
|
|
100
|
+
PYMEM_ALLOCATOR_NOT_SET does nothing. */
|
|
101
|
+
extern int _PyMem_SetupAllocators(PyMemAllocatorName allocator);
|
|
102
|
+
|
|
103
|
+
// Default raw memory allocator that is not affected by PyMem_SetAllocator()
|
|
104
|
+
extern void *_PyMem_DefaultRawMalloc(size_t);
|
|
105
|
+
extern void *_PyMem_DefaultRawCalloc(size_t, size_t);
|
|
106
|
+
extern void *_PyMem_DefaultRawRealloc(void *, size_t);
|
|
107
|
+
extern void _PyMem_DefaultRawFree(void *);
|
|
108
|
+
extern wchar_t *_PyMem_DefaultRawWcsdup(const wchar_t *str);
|
|
109
|
+
|
|
110
|
+
/* Is the debug allocator enabled? */
|
|
111
|
+
extern int _PyMem_DebugEnabled(void);
|
|
112
|
+
|
|
113
|
+
// Enqueue a pointer to be freed possibly after some delay.
|
|
114
|
+
extern void _PyMem_FreeDelayed(void *ptr, size_t size);
|
|
115
|
+
|
|
116
|
+
// Enqueue an object to be freed possibly after some delay
|
|
117
|
+
#ifdef Py_GIL_DISABLED
|
|
118
|
+
PyAPI_FUNC(void) _PyObject_XDecRefDelayed(PyObject *obj);
|
|
119
|
+
#else
|
|
120
|
+
static inline void _PyObject_XDecRefDelayed(PyObject *obj)
|
|
121
|
+
{
|
|
122
|
+
Py_XDECREF(obj);
|
|
123
|
+
}
|
|
124
|
+
#endif
|
|
125
|
+
|
|
126
|
+
// Periodically process delayed free requests.
|
|
127
|
+
extern void _PyMem_ProcessDelayed(PyThreadState *tstate);
|
|
128
|
+
|
|
129
|
+
// Periodically process delayed free requests when the world is stopped.
|
|
130
|
+
// Notify of any objects whic should be freeed.
|
|
131
|
+
typedef void (*delayed_dealloc_cb)(PyObject *, void *);
|
|
132
|
+
extern void _PyMem_ProcessDelayedNoDealloc(PyThreadState *tstate,
|
|
133
|
+
delayed_dealloc_cb cb, void *state);
|
|
134
|
+
|
|
135
|
+
// Abandon all thread-local delayed free requests and push them to the
|
|
136
|
+
// interpreter's queue.
|
|
137
|
+
extern void _PyMem_AbandonDelayed(PyThreadState *tstate);
|
|
138
|
+
|
|
139
|
+
// On interpreter shutdown, frees all delayed free requests.
|
|
140
|
+
extern void _PyMem_FiniDelayed(PyInterpreterState *interp);
|
|
141
|
+
|
|
142
|
+
#ifdef __cplusplus
|
|
143
|
+
}
|
|
144
|
+
#endif
|
|
145
|
+
#endif // !Py_INTERNAL_PYMEM_H
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#ifndef Py_INTERNAL_PYMEM_INIT_H
|
|
2
|
+
#define Py_INTERNAL_PYMEM_INIT_H
|
|
3
|
+
#ifdef __cplusplus
|
|
4
|
+
extern "C" {
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#ifndef Py_BUILD_CORE
|
|
8
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
/********************************/
|
|
13
|
+
/* the allocators' initializers */
|
|
14
|
+
|
|
15
|
+
extern void * _PyMem_RawMalloc(void *, size_t);
|
|
16
|
+
extern void * _PyMem_RawCalloc(void *, size_t, size_t);
|
|
17
|
+
extern void * _PyMem_RawRealloc(void *, void *, size_t);
|
|
18
|
+
extern void _PyMem_RawFree(void *, void *);
|
|
19
|
+
#define PYRAW_ALLOC {NULL, _PyMem_RawMalloc, _PyMem_RawCalloc, _PyMem_RawRealloc, _PyMem_RawFree}
|
|
20
|
+
|
|
21
|
+
#ifdef Py_GIL_DISABLED
|
|
22
|
+
// Py_GIL_DISABLED requires mimalloc
|
|
23
|
+
extern void* _PyObject_MiMalloc(void *, size_t);
|
|
24
|
+
extern void* _PyObject_MiCalloc(void *, size_t, size_t);
|
|
25
|
+
extern void _PyObject_MiFree(void *, void *);
|
|
26
|
+
extern void* _PyObject_MiRealloc(void *, void *, size_t);
|
|
27
|
+
# define PYOBJ_ALLOC {NULL, _PyObject_MiMalloc, _PyObject_MiCalloc, _PyObject_MiRealloc, _PyObject_MiFree}
|
|
28
|
+
extern void* _PyMem_MiMalloc(void *, size_t);
|
|
29
|
+
extern void* _PyMem_MiCalloc(void *, size_t, size_t);
|
|
30
|
+
extern void _PyMem_MiFree(void *, void *);
|
|
31
|
+
extern void* _PyMem_MiRealloc(void *, void *, size_t);
|
|
32
|
+
# define PYMEM_ALLOC {NULL, _PyMem_MiMalloc, _PyMem_MiCalloc, _PyMem_MiRealloc, _PyMem_MiFree}
|
|
33
|
+
#elif defined(WITH_PYMALLOC)
|
|
34
|
+
extern void* _PyObject_Malloc(void *, size_t);
|
|
35
|
+
extern void* _PyObject_Calloc(void *, size_t, size_t);
|
|
36
|
+
extern void _PyObject_Free(void *, void *);
|
|
37
|
+
extern void* _PyObject_Realloc(void *, void *, size_t);
|
|
38
|
+
# define PYOBJ_ALLOC {NULL, _PyObject_Malloc, _PyObject_Calloc, _PyObject_Realloc, _PyObject_Free}
|
|
39
|
+
# define PYMEM_ALLOC PYOBJ_ALLOC
|
|
40
|
+
#else
|
|
41
|
+
# define PYOBJ_ALLOC PYRAW_ALLOC
|
|
42
|
+
# define PYMEM_ALLOC PYOBJ_ALLOC
|
|
43
|
+
#endif // WITH_PYMALLOC
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
extern void* _PyMem_DebugRawMalloc(void *, size_t);
|
|
47
|
+
extern void* _PyMem_DebugRawCalloc(void *, size_t, size_t);
|
|
48
|
+
extern void* _PyMem_DebugRawRealloc(void *, void *, size_t);
|
|
49
|
+
extern void _PyMem_DebugRawFree(void *, void *);
|
|
50
|
+
|
|
51
|
+
extern void* _PyMem_DebugMalloc(void *, size_t);
|
|
52
|
+
extern void* _PyMem_DebugCalloc(void *, size_t, size_t);
|
|
53
|
+
extern void* _PyMem_DebugRealloc(void *, void *, size_t);
|
|
54
|
+
extern void _PyMem_DebugFree(void *, void *);
|
|
55
|
+
|
|
56
|
+
#define PYDBGRAW_ALLOC(runtime) \
|
|
57
|
+
{&(runtime).allocators.debug.raw, _PyMem_DebugRawMalloc, _PyMem_DebugRawCalloc, _PyMem_DebugRawRealloc, _PyMem_DebugRawFree}
|
|
58
|
+
#define PYDBGMEM_ALLOC(runtime) \
|
|
59
|
+
{&(runtime).allocators.debug.mem, _PyMem_DebugMalloc, _PyMem_DebugCalloc, _PyMem_DebugRealloc, _PyMem_DebugFree}
|
|
60
|
+
#define PYDBGOBJ_ALLOC(runtime) \
|
|
61
|
+
{&(runtime).allocators.debug.obj, _PyMem_DebugMalloc, _PyMem_DebugCalloc, _PyMem_DebugRealloc, _PyMem_DebugFree}
|
|
62
|
+
|
|
63
|
+
extern void * _PyMem_ArenaAlloc(void *, size_t);
|
|
64
|
+
extern void _PyMem_ArenaFree(void *, void *, size_t);
|
|
65
|
+
|
|
66
|
+
#ifdef Py_DEBUG
|
|
67
|
+
# define _pymem_allocators_standard_INIT(runtime) \
|
|
68
|
+
{ \
|
|
69
|
+
PYDBGRAW_ALLOC(runtime), \
|
|
70
|
+
PYDBGMEM_ALLOC(runtime), \
|
|
71
|
+
PYDBGOBJ_ALLOC(runtime), \
|
|
72
|
+
}
|
|
73
|
+
# define _pymem_is_debug_enabled_INIT 1
|
|
74
|
+
#else
|
|
75
|
+
# define _pymem_allocators_standard_INIT(runtime) \
|
|
76
|
+
{ \
|
|
77
|
+
PYRAW_ALLOC, \
|
|
78
|
+
PYMEM_ALLOC, \
|
|
79
|
+
PYOBJ_ALLOC, \
|
|
80
|
+
}
|
|
81
|
+
# define _pymem_is_debug_enabled_INIT 0
|
|
82
|
+
#endif
|
|
83
|
+
|
|
84
|
+
#define _pymem_allocators_debug_INIT \
|
|
85
|
+
{ \
|
|
86
|
+
{'r', PYRAW_ALLOC}, \
|
|
87
|
+
{'m', PYMEM_ALLOC}, \
|
|
88
|
+
{'o', PYOBJ_ALLOC}, \
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
# define _pymem_allocators_obj_arena_INIT \
|
|
92
|
+
{ NULL, _PyMem_ArenaAlloc, _PyMem_ArenaFree }
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
#define _Py_mem_free_queue_INIT(queue) \
|
|
96
|
+
{ \
|
|
97
|
+
.head = LLIST_INIT(queue.head), \
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
#ifdef __cplusplus
|
|
101
|
+
}
|
|
102
|
+
#endif
|
|
103
|
+
#endif // !Py_INTERNAL_PYMEM_INIT_H
|