__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#ifndef GREENLET_MSVC_COMPAT_HPP
#define GREENLET_MSVC_COMPAT_HPP
/*
* Support for MSVC on Windows.
*
* Beginning with Python 3.14, some of the internal
* include files we need are not compatible with MSVC
* in C++ mode:
*
* internal\pycore_stackref.h(253): error C4576: a parenthesized type
* followed by an initializer list is a non-standard explicit type conversion syntax
*
* This file is included from ``internal/pycore_interpframe.h``, which
* we need for the ``_PyFrame_IsIncomplete`` API.
*
* Unfortunately, that API is a ``static inline`` function, as are a
* bunch of the functions it calls. The only solution seems to be to
* copy those definitions and the supporting inline functions here.
*
* Now, this makes us VERY fragile to changes in those functions. Because
* they're internal and static, the CPython devs might feel free to change
* them in even minor versions, meaning that we could runtime link and load,
* but still crash. We have that problem on all platforms though. It's just worse
* here because we have to keep copying the updated definitions.
*/
#include <Python.h>
#include "greenlet_cpython_compat.hpp"
// This file is only included on 3.14+
extern "C" {
// pycore_code.h ----------------
#define _PyCode_CODE(CO) _Py_RVALUE((_Py_CODEUNIT *)(CO)->co_code_adaptive)
#ifdef Py_GIL_DISABLED
static inline _PyCodeArray *
_PyCode_GetTLBCArray(PyCodeObject *co)
{
return _Py_STATIC_CAST(_PyCodeArray *,
_Py_atomic_load_ptr_acquire(&co->co_tlbc));
}
#endif
// End pycore_code.h ----------
// pycore_interpframe.h ----------
#if !defined(Py_GIL_DISABLED) && defined(Py_STACKREF_DEBUG)
#define Py_TAG_BITS 0
#else
#define Py_TAG_BITS ((uintptr_t)1)
#define Py_TAG_DEFERRED (1)
#endif
static const _PyStackRef PyStackRef_NULL = { .bits = Py_TAG_DEFERRED};
#define PyStackRef_IsNull(stackref) ((stackref).bits == PyStackRef_NULL.bits)
static inline PyObject *
PyStackRef_AsPyObjectBorrow(_PyStackRef stackref)
{
PyObject *cleared = ((PyObject *)((stackref).bits & (~Py_TAG_BITS)));
return cleared;
}
static inline PyCodeObject *_PyFrame_GetCode(_PyInterpreterFrame *f) {
assert(!PyStackRef_IsNull(f->f_executable));
PyObject *executable = PyStackRef_AsPyObjectBorrow(f->f_executable);
assert(PyCode_Check(executable));
return (PyCodeObject *)executable;
}
static inline _Py_CODEUNIT *
_PyFrame_GetBytecode(_PyInterpreterFrame *f)
{
#ifdef Py_GIL_DISABLED
PyCodeObject *co = _PyFrame_GetCode(f);
_PyCodeArray *tlbc = _PyCode_GetTLBCArray(co);
assert(f->tlbc_index >= 0 && f->tlbc_index < tlbc->size);
return (_Py_CODEUNIT *)tlbc->entries[f->tlbc_index];
#else
return _PyCode_CODE(_PyFrame_GetCode(f));
#endif
}
static inline bool //_Py_NO_SANITIZE_THREAD
_PyFrame_IsIncomplete(_PyInterpreterFrame *frame)
{
if (frame->owner >= FRAME_OWNED_BY_INTERPRETER) {
return true;
}
return frame->owner != FRAME_OWNED_BY_GENERATOR &&
frame->instr_ptr < _PyFrame_GetBytecode(frame) +
_PyFrame_GetCode(frame)->_co_firsttraceable;
}
// pycore_interpframe.h ----------
}
#endif // GREENLET_MSVC_COMPAT_HPP
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| platform | Folder | 0755 |
|
|
| tests | Folder | 0755 |
|
|
| CObjects.cpp | File | 3.57 KB | 0644 |
|
| PyGreenlet.cpp | File | 27.52 KB | 0644 |
|
| PyGreenlet.hpp | File | 1.43 KB | 0644 |
|
| PyGreenletUnswitchable.cpp | File | 4.06 KB | 0644 |
|
| PyModule.cpp | File | 8.59 KB | 0644 |
|
| TBrokenGreenlet.cpp | File | 1021 B | 0644 |
|
| TExceptionState.cpp | File | 1.33 KB | 0644 |
|
| TGreenlet.cpp | File | 25.62 KB | 0644 |
|
| TGreenlet.hpp | File | 28.58 KB | 0644 |
|
| TGreenletGlobals.cpp | File | 3.84 KB | 0644 |
|
| TMainGreenlet.cpp | File | 3.51 KB | 0644 |
|
| TPythonState.cpp | File | 19.15 KB | 0644 |
|
| TStackState.cpp | File | 7.21 KB | 0644 |
|
| TThreadState.hpp | File | 23.34 KB | 0644 |
|
| TThreadStateCreator.hpp | File | 2.7 KB | 0644 |
|
| TThreadStateDestroy.cpp | File | 7.99 KB | 0644 |
|
| TUserGreenlet.cpp | File | 23.76 KB | 0644 |
|
| __init__.py | File | 1.41 KB | 0644 |
|
| _greenlet.cpython-312-x86_64-linux-gnu.so | File | 1.32 MB | 0755 |
|
| greenlet.cpp | File | 10.83 KB | 0644 |
|
| greenlet.h | File | 4.64 KB | 0644 |
|
| greenlet_allocator.hpp | File | 1.79 KB | 0644 |
|
| greenlet_compiler_compat.hpp | File | 4.24 KB | 0644 |
|
| greenlet_cpython_compat.hpp | File | 3.25 KB | 0644 |
|
| greenlet_exceptions.hpp | File | 4.4 KB | 0644 |
|
| greenlet_internal.hpp | File | 2.7 KB | 0644 |
|
| greenlet_msvc_compat.hpp | File | 3.12 KB | 0644 |
|
| greenlet_refs.hpp | File | 37.17 KB | 0644 |
|
| greenlet_slp_switch.hpp | File | 3.22 KB | 0644 |
|
| greenlet_thread_support.hpp | File | 867 B | 0644 |
|
| slp_platformselect.h | File | 3.87 KB | 0644 |
|